 |
 |
Enabling PHP locally on Apache
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2002
Location: over yonder
Status:
Offline
|
|
I'm trying to enable PHP on my computer locally so I can test my scripts without uploading them to my webhost.
I've followed the directions here, and the Apache error log reports that everything started up normally with PHP enabled.
However, when I tried to access the page I was working on, it just spit the source back at me rather than displaying it as a webpage.
I've tried permissions, I've set it as 755.
Any suggestions?
|
|
chown -R us:us yourbase
Dissent is not un-American.
|
| |
|
|
|
 |
|
 |
|
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status:
Offline
|
|
did you run sudo apachectl graceful afterwards?
|
|
"Have sharp knives. Be creative. Cook to music" ~ maxelson
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2002
Location: over yonder
Status:
Offline
|
|
Originally posted by philzilla:
did you run sudo apachectl graceful afterwards?
Thanks for the suggestion, but it's still doing the same thing.
It's just spitting the source back at me.
Anyone else have any suggestions?
|
|
chown -R us:us yourbase
Dissent is not un-American.
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Dec 2002
Status:
Offline
|
|
|
|
|
Travis Sanderson
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Aug 2002
Status:
Offline
|
|
it really sounds like you don't have the following lines uncommented:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
(make sure there isn't a # sign in front of them)
if those two are uncommented, try going to a page that doesn't exist ( http://localhost/nonexistantpage.html) and see if it shows php in it's signiture. you should get something like:
Apache/1.3.27 mod_perl/1.99_07-dev Perl/v5.8.0 php version Server at localhost Port 80
if it isn't there then it (probably) isn't loaded.
--will
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2002
Location: over yonder
Status:
Offline
|
|
Originally posted by clam2000:
it really sounds like you don't have the following lines uncommented:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
(make sure there isn't a # sign in front of them)
if those two are uncommented, try going to a page that doesn't exist (http://localhost/nonexistantpage.html) and see if it shows php in it's signiture. you should get something like:
Apache/1.3.27 mod_perl/1.99_07-dev Perl/v5.8.0 php version Server at localhost Port 80
if it isn't there then it (probably) isn't loaded.
--will
No. It was loaded as indicated by the terminal line when Apache was loaded.
I had to go download the distribution from 'entropy.ch' which fixed the problems and everything is working normally.
Thank you for all your help!
|
|
chown -R us:us yourbase
Dissent is not un-American.
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Dec 2002
Status:
Offline
|
|
I know you already fixed the problem via entropy, but:
It sounds like you're fairly computer-literate  so I doubt this is the problem, but did you edit httpd.conf with root rights? I know if you use pico, it isn't all that obvious if you start editing it with normal rights. Just wonderin'.
|
|
Travis Sanderson
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2002
Location: over yonder
Status:
Offline
|
|
Originally posted by redJag:
I know you already fixed the problem via entropy, but:
It sounds like you're fairly computer-literate so I doubt this is the problem, but did you edit httpd.conf with root rights? I know if you use pico, it isn't all that obvious if you start editing it with normal rights. Just wonderin'.
Yeah, I did edit httpd.conf with root rights. I actually just logged in as root and then opened the httpd.conf file with BBEdit.
Thanks for the suggestion.
|
|
chown -R us:us yourbase
Dissent is not un-American.
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Jan 2001
Location: East of Belfast Furry Animal Sanctuary
Status:
Offline
|
|
you using safari for testing as it can be a pain with caching on the local server.
Also is the php file a 'text' file, try putting it onto your local server using an ftp tool like fetch and set it ascii/text for upload.
This was sometimes a problem for me and this fixed it
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2002
Location: over yonder
Status:
Offline
|
|
Originally posted by Griggsy:
you using safari for testing as it can be a pain with caching on the local server.
Also is the php file a 'text' file, try putting it onto your local server using an ftp tool like fetch and set it ascii/text for upload.
This was sometimes a problem for me and this fixed it
No, I wasn't using Safari. I was using Opera.
Yes, the file was text, saved that way in BBEdit.
Thanks for the suggestions everyone, using the distribution from 'entropy.ch' solved the problem and everything works great. Thank you!
|
|
chown -R us:us yourbase
Dissent is not un-American.
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|