Cannot get php to work in tiger

b8edbreth

Registered
I just updated to 10.4 from 10.3. In 10.3 php worked perfectly for me and I was using the machine as a little test bed for my sites. Now when I go to a php page I just get raw html output. I tried enabling the mod_php4 in the httpd.conf file but afterward going to a php page resulted in me being told that the page was and application and had to be downloaded. So I got the version of php and founmd to my surprise that even though I'd built and installed php 5 on panther, it was php 4 something (Don't remember the exact version.) tried downloading 5 again and building and installing. Well I don't know where tiger gets it's php from but it isn't the correct place. after the build and install it's still 4. cannot update apache either. Tried doing a download and install of the newest apache and well that did nothing. Help please <yipe>. I found an article here that showed how (at one time) to fix this but I tried it and it did not work, I still only get raw html in the browser window when I go to a php page on localhost. I would be eternally grateful to any one that can help me fix this... or better yet, tell me where the php and httpd files tiger uses are so I can just simlink them to the ones I built. (The search tool no longer searches in all of the directories on the drive, only the visible ones.)
Thanks again,
April.
 
b8edbreth said:
tell me where the php and httpd files tiger uses are so I can just simlink them to the ones I built. (The search tool no longer searches in all of the directories on the drive, only the visible ones.)
Thanks again,
April.



Php is in /usr/lib/php and /usr/bin/php

drop to a bash shell and do a $ locate php

apache config file should be in

/etc/httpd/

Sounds like the problem is in the httpd.conf file you might need to enable php in there. By default, your document root is set to /Sites/ --- I always change mine to match my server, for instance, I run hsphere on my web server so on my local machine my files are in :

/hsphere/local/home/accountname1/accountname1.com/
/hsphere/local/home/accountname2/accountname2.com/


Thus, if I have to include an absolute path to an include file, say in the root, I don't have to keep changing the path in my scripts before I do the actual upload from my local mac testing server to my actual online web servers.

Hope this helps.

ngcomputing.com
 
Well those are all the correct locations for the php and apache files from panther or any linux system I've run. And I did enable php in the httpd.conf but still I just get raw html in the browser window and the versions I built with ./configure ; make ; make install are not the ones being used by tiger. So I guess I'm asking where are the apache and php binaries that Tiger uses? What I want to do is delete them (or perhaps just rename them httpd.old and php.old) and use a terminal to make symbolic links to the correct ones. Meaning the ones that regular n*x systems would use.



ngcomputing said:
Php is in /usr/lib/php and /usr/bin/php

drop to a bash shell and do a $ locate php

apache config file should be in

/etc/httpd/

Sounds like the problem is in the httpd.conf file you might need to enable php in there. By default, your document root is set to /Sites/ --- I always change mine to match my server, for instance, I run hsphere on my web server so on my local machine my files are in :

/hsphere/local/home/accountname1/accountname1.com/
/hsphere/local/home/accountname2/accountname2.com/


Thus, if I have to include an absolute path to an include file, say in the root, I don't have to keep changing the path in my scripts before I do the actual upload from my local mac testing server to my actual online web servers.

Hope this helps.

ngcomputing.com
 
You might need to log in as root and do a locate. Also, it sounds simple, but remember to stop then restart personal web sharing after you make any changes to the .conf files.
 
I don't know what I'm doing wrong but Im still not having any luck.Has any one else been able to get php to work in Tiger?
 
sudo pico /etc/httpd/httpd.conf

I then uncommented the LoadModule and AddModule lines that had to do with php, then sudo apachectl restart.

Worked flawlessly.
 
PCheese said:
sudo pico /etc/httpd/httpd.conf

I then uncommented the LoadModule and AddModule lines that had to do with php, then sudo apachectl restart.

Worked flawlessly.

Ok, I figured it out... Let me reiterate just in case some one else is reading and goes through the same thing.
I was using Panther and had downloaded and built from source php 5.0.4 and apache 2.0.39 if I'm not wrong. So in panther I was pretty close to current. I bought Tiger and installed, just doing an upgrade install. PHP and Apache broke. I did all the httpd.conf stuff and it did not work. I tried redownloading and building php and apache. it did not work.
Last night I did what I REALLY didn't want to do. I did an archive and install.
I uncommented the php related lines in httpd.conf. and TaDah! it works.

April.
 
I had the same problem, but uncommenting the PHP-related lines in httpd.conf then restarting Apache did the trick.
 
Back
Top