Php 5.2 install problem


#1

(I had originally posted this in programming… might have placed it in the wrong forum, so I’ll try here)

Hi!
I attempted to install php 5.2 following the wiki guidelines because I need the JSON extension. I followed the instructions (or so I thought) but according to phpinfo, I’m running version 5.1.2.
From what I can guess, whatever needs to be “told” to look for the php install isn’t looking in the right place (right to me, anyway).
This may be an Ubernoobie question, but should the php files be in a www (for lack of a better term) directory? right now, it’s in
/home/.zac/username/php5
while my site path is
/home/.zac/username/mydomain.com/
and the ini file is in
/home/.zac/username/mydomain.com/cgi-bin/php.ini
is there a specific section of my php.ini that I need to change? Is there something I need to change in .htaccess (I used the default .htaccess from the wiki, but it didn’t change the install).
I’ve hunted 'round the 'net trying to find the answer to this, but to no avail, and I’m really trying to understand/learn. Please help!
Thanks-- Andrea


#2

Which wiki article did you follow? The wiki contains a few different articles on the subject.

Usually, your php.cgi and php.ini file would be in /mydomain/com/cgi-bin/ and your .htaccess file would be placed in /mydomain.com/ . Your .htaccess file should contain something like the following…

Options +ExecCGI
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php.cgi

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)


#3

Thanks for responding!
I followed the guidelines at:
http://wiki.dreamhost.com/index.php/Installing_PHP5

All of my files are set up in directories as you noted. The actual php 5.2 files (not the ini or the cgi) are in
/home/.zac/username/php5

Is there some line in the ini file that will point to the php5 directory?
–Thanks again–
Andrea


#4

[quote]All of my files are set up in directories as you noted. The actual php 5.2 files (not the ini or the cgi) are in
/home/.zac/username/php5[/quote]
The php.cgi and php.ini files are the only ones that you need be concerned with at the moment, as they are the php executable and configuration file respectively. The other files in /username/php5/ are only required to build the executable.

Not that I am aware of. It is the lines you added to the .htaccess file that tell Apache which PHP executable to use.

When you run phpinfo() , what is shown for Configuration File (php.ini) Path ?

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)


#5

the listed path is /home/.zac/username/domain.com/cgi-bin/php.ini
Thanks again!
–Andrea


#6

This indicates that your domain is indeed using your custom PHP executable and php.ini file. If it was using the standard DreamHost PHP install, it would be showing something like ‘/etc/php5/cgi/php.ini’

As for the PHP version not being 5.2 as you expected, I can only guess that you have somehow compiled an earlier version of the source.

Which wiki article did you follow?

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)


#7

[quote]
Which wiki article did you follow?[/quote]
http://wiki.dreamhost.com/index.php/Installing_PHP5
which includes installscript with line
wget -c http://us3.php.net/distributions/${PHP5}.tar.gz
It appears to pull 5.2.0.
I also checked out hiveminds.co.uk, which has the original script (from an article devoted to installing 5.2.0 at Dreamhost).
I appreciate your patience! I’m really trying to understand this-- not just “fix” it this one time.


#8

I just had a quick look at the script and I agree, it really should be retrieving the correct 5.2.0 package.

I am really at a loss to explain what might be happening here, since it seems that you do have a working PHP executable at /domain.com/cgi-bin/ and the phpinfo() results indicate that the new executable and ini file are being used, but obviously the executable is not the version expected.

Did you follow any other wiki articles before the one you posted? The reason I ask is that there is a wiki article on copying the existing DreamHost PHP install across to your own domain. If you followed those instructions sometime before doing the full compile, it may explain how you ended up with a PHP 5.1.2 executable in your /cgi-bin/ directory.

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)


#9

Well, I’ve tried what I can. I even attempted to delete and reinstall/recompile php and now, of course, I’m getting the Error 1/ Error 2 that is being discussed in other posts.

Thanks for all of your help-- you confirmed that I appeared to have followed the process correctly, which really did help.


#10

No problem, I am sorry I couldn’t be of more assistance.

Perhaps someone else might have a better idea of what the problem could be.

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)