image
image

Go Back   macosx.com > Mac Help Forums > Mac OS X System & Mac Software

Reply
 
Thread Tools
  #1  
Old May 2nd, 2005, 01:06 PM
Registered User
 
Join Date: May 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
b8edbreth is on a distinguished road
Cannot get php to work in tiger

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.
Reply With Quote
  #2  
Old May 2nd, 2005, 03:00 PM
Registered User
 
Join Date: Nov 2004
Location: Florida
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
ngcomputing is on a distinguished road
Quote:
Originally Posted by b8edbreth
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
Reply With Quote
  #3  
Old May 2nd, 2005, 03:33 PM
Registered User
 
Join Date: May 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
b8edbreth is on a distinguished road
RE: Cannot get php to work in tiger

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.



Quote:
Originally Posted by ngcomputing
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
Reply With Quote
  #4  
Old May 2nd, 2005, 04:02 PM
Registered User
 
Join Date: Nov 2004
Location: Florida
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
ngcomputing is on a distinguished road
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.
Reply With Quote
  #5  
Old May 4th, 2005, 10:50 AM
Registered User
 
Join Date: May 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
b8edbreth is on a distinguished road
re Cannot get php to work in tiger

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?
Reply With Quote
  #6  
Old May 5th, 2005, 10:52 AM
Registered User
 
Join Date: Feb 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
PCheese is on a distinguished road
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.
Reply With Quote
  #7  
Old May 5th, 2005, 01:12 PM
Registered User
 
Join Date: May 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
b8edbreth is on a distinguished road
Quote:
Originally Posted by PCheese
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.
Reply With Quote
  #8  
Old May 11th, 2005, 01:40 PM
larry98765's Avatar
Registered User
 
Join Date: Dec 2002
Location: Oakland CA
Posts: 259
Thanks: 0
Thanked 0 Times in 0 Posts
larry98765 is on a distinguished road
I had the same problem, but uncommenting the PHP-related lines in httpd.conf then restarting Apache did the trick.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP & MySQL wont Communicate ackfeldwire Design & Media 8 March 29th, 2005 10:23 AM
Über n00b setting up PHP and MySQL - shell syntax problem? midazolam Design & Media 25 March 28th, 2005 11:14 AM
Looking for a PHP guru to work on a project drunkmac Software Programming & Web Scripting 1 January 19th, 2005 09:34 PM
PHP wont work, what else can I do?? AjAy2 Mac OS X System & Mac Software 6 November 15th, 2004 05:54 PM
Anyone got PHP to work yet? barenakedAvenger Mac OS X System & Mac Software 21 October 15th, 2000 11:53 AM


All times are GMT -5. The time now is 03:12 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.