How can I enable PHP5 for a site? Having problems with every single method.

Posted by user347662 on Stack Overflow See other posts from Stack Overflow or by user347662
Published on 2010-05-22T06:29:46Z Indexed on 2010/05/22 6:40 UTC
Read the original article Hit count: 403

Filed under:
|
|
|

I'm working on a client site that is hosted on someone's DIY Debian Linux server [Apache/1.3.33 (Debian GNU/Linux)], and I'm trying to install a script that requires PHP5. By default, the server parses .php files with PHP 4.3.10-22, which is configured at /etc/php4/apache/php.ini, according to phpinfo(). On the server I can see a config directory for PHP5 adjacent to the PHP4 directory: /etc/php5.0/apache2/php.ini.

I have tried multiple methods to enable PHP5 for the document root where the site's files are hosted, including all available methods mentioned here. By far, the most common suggestion I've found is to add one or both of the following lines to the site's .htaccess file:

AddHandler application/x-httpd-php5 .php
AddType application/x-httpd-php5 .php

Trouble is, when either or both of those lines are present, the site forces my browser to download any .php files requested, without parsing the PHP at all. All of the other methods mentioned in the above article cause a 500 Internal Server Error. There is no hosting control panel I can access in a browser to enable PHP5 for the site, but I do have shell access.

When I asked the server administrator about this issue, he encouraged me to search for the answer on Google.

Where could I begin to troubleshoot this issue? Are there ways to test or verify the server's specific PHP5 installation and configuration, using the command line or some other method? Do you have other suggestions to enable PHP5?

© Stack Overflow or respective owner

How can I enable PHP5 for a site? Having problems with every single method.

Posted by John Stephens on Server Fault See other posts from Server Fault or by John Stephens
Published on 2010-05-22T15:11:58Z Indexed on 2010/05/22 15:21 UTC
Read the original article Hit count: 402

Filed under:
|
|
|
|

I'm working on a client site that is hosted on someone's DIY Debian Linux server [Apache/1.3.33 (Debian GNU/Linux)], and I'm trying to install a script that requires PHP5. By default, the server parses .php files with PHP 4.3.10-22, which is configured at /etc/php4/apache/php.ini, according to phpinfo(). On the server I can see a config directory for PHP5 adjacent to the PHP4 directory: /etc/php5.0/apache2/php.ini.

I have tried multiple methods to enable PHP5 for the document root where the site's files are hosted, including all available methods mentioned here. By far, the most common suggestion I've found is to add one or both of the following lines to the site's .htaccess file:

AddHandler application/x-httpd-php5 .php
AddType application/x-httpd-php5 .php

Trouble is, when either or both of those lines are present, the site forces my browser to download any .php files requested, without parsing the PHP at all. All of the other methods mentioned in the above article cause a 500 Internal Server Error. There is no hosting control panel I can access in a browser to enable PHP5 for the site, but I do have shell access.

When I asked the server administrator about this issue, he encouraged me to search for the answer on Google.

Where could I begin to troubleshoot this issue? Are there ways to test or verify the server's specific PHP5 installation and configuration, using the command line or some other method? Do you have other suggestions to enable PHP5?

© Server Fault or respective owner

Related posts about php5

Related posts about .htaccess