How To Set Up suPHP With PHP4 And PHP5 - Page 3
7 suPHP and PHP5In this section we install PHP5 and make it work with suPHP. The PHP4-CGI will not be removed by this!
7.1 Install PHP5As there is no official PHP5 package for Debian Sarge, we must install third-party packages. There are some repositories like backports.org or dotdeb.org that provide such packages. In the following, we will install the PHP5-CGI package from dotdeb.org. Add the following lines to /etc/apt/sources.list (don't remove the other repositories!): vi /etc/apt/sources.list
Then run apt-get update Install php5-cgi like this: apt-get install php5-cgi
7.2 Configure ApacheThe headline is a little bit misleading. Actually we don't have to change the Apache configuration. We still have our vhost like above:
All we have to do to make our www.example.com vhost use PHP5 is change the x-httpd-php line in /etc/suphp.conf. It must now point to our php5-cgi binary: vi /etc/suphp.conf
You don't even have to restart Apache! Now go to http://www.example.com/info.php again with your browser, and you should see that PHP5 is running:
8 PHP4 And PHP5 At The Same TimeNow we have both php4-cgi and php5-cgi installed on our server. If you have multiple vhosts on your server, you can have one use PHP4 and the other use PHP5 at the same time. To do this, we define two handlers in /etc/suphp.conf. Edit the [handlers] section so that it looks like this: vi /etc/suphp.conf
If you want to use PHP4 in your vhost, use the x-httpd-php handler:
If you want to use PHP5, use the x-httpd-php5 handler:
Don't forget to restart Apache after the changes to your vhosts: /etc/init.d/apache2 restart
9 Links
|




print: 
Recent comments
7 hours 51 min ago
8 hours 51 min ago
11 hours 34 min ago
12 hours 1 min ago
12 hours 31 min ago
13 hours 20 min ago
13 hours 43 min ago
14 hours 26 min ago
15 hours 47 min ago
16 hours 16 min ago