Custom PHP Install Issue

software development

#1

I have followed the instructions to compile a custom install of PHP from the wiki, all looks fine when I run ./php-config -v in a shell.

However I have problems when viewing through a browser.

I have added a .htaccess file to my domain root:
If I add:
Action application/x-httpd-php5 /cgi-bin/php.cgi
AddType application/x-httpd-php5 .php

The sites ignores this and continues to run the default PHP install

If I add:
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php.cgi

I get a 500 internal server error.

Anyone experienced similar problems or know if I can view the server error logs for the 500 server error.

Thanks


#2

If you just want to gain access to a PHP.INI check out my signature.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#3

I have created a compiled custom version of PHP to use the mhash library - I am under the impression (maybe mistakenly) that editing php.ini is not required to required for a custom install?


#4

No, you don’t need to edit your ini in order to customise php. The majority of users who attempt customisation are those who’re just wanting to edit their PHP.INI rather than implement extra functionality, so I threw that out there in case you fell in the majority.

Check that your php.cgi and php.ini have been copied correctly into your domain’s cgi-bin folder and use the second .htaccess example you gave above.

Check permissions:

0711 /cgi-bin (directory)
0700 /cgi-bin/php.cgi
0600 /cgi-bin/php.ini

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#5

Apologies, I am struggling with this… The script I used (http://wiki.dreamhost.com/Installing_PHP5#Main_PHP_5_install_script) copies the php.cgi file into cgi-bin, but not the php.ini. This goes in /DOMAIN/php5/etc/php5/DOMAIN/

I have tried moving the php.ini manually into the cgi-bin, and changing the permissions as mentioned… but I still get the following conditions which ever location the php.ini placed.

#if domian .htaccess file 1
Action application/x-httpd-php5 /cgi-bin/php.cgi
AddType application/x-httpd-php5 .php

my phpinfo() is PHP Version 5.2.6 - Build: May 11 2008 13:09:07 the DH one - not my configured one from January

#if domain .htaccess file version 2
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php.cgi

I get the internal server error

#if domain .htaccess file version 3
AddHandler php-cgi .php
#Action php-cgi /cgi-bin/php.cgi

My phpinfo() is Version 4.4.2 - Build Apr 18 2006 12:40:09

My custom version is there under /DOMAIN/php5/ … I just cannot get the domain to use it!!

I would very much appreciate any more help. Many Thanks.


#6

What does phpinfo(); report on those .htaccess’s for Loaded Configuration File?

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#7

#if domian .htaccess file 1
Action application/x-httpd-php5 /cgi-bin/php.cgi
AddType application/x-httpd-php5 .php

Configuration File (php.ini) Path = /etc/php5/cgi
Loaded Configuration File = /etc/php5/cgi/php.ini

#if domain .htaccess file version 2
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php.cgi

Internal server error

#if domain .htaccess file version 3
AddHandler php-cgi .php
#Action php-cgi /cgi-bin/php.cgi

Configuration File (php.ini) Path = /etc/php/cgi/php.ini


#8

If the permissions are set as described above then it might be a bad compile. I’m going to take a guess you’ve probably tried recompiling it (once or twice), but if that’s not the case, give it another whirl.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost