Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > PHP not working right

PHP not working right
Thread Tools
SS3 GokouX
Dedicated MacNNer
Join Date: Jul 2001
Location: The Land of More :(
Status: Offline
Reply With Quote
Aug 27, 2001, 07:16 PM
 
I installed PHP using the instructions from here it installed fine (I downloaded the web sharing update long ago before doing this). I've also installed MySQL from the same site if that makes any difference (I installed PHP after MySQL). Everything seems to be fine, except that rather than executing the php script, the script is downloaded instead. I've tried it in OmniWeb, iCab, and Explorer, I've also had my friends to try it and it downloads the scripts, too. I really don't understand why it's doing this, it should recognize .php files as PHP scripts and execute them. Any help would be greatly appreciated.

"And I will rule you all with an iron fist! You! OBEY THE FIST!" -Invader Zim
     
timster
Dedicated MacNNer
Join Date: Oct 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Aug 27, 2001, 09:27 PM
 
Sounds like you didnt get the application types in the httpd.conf file.

Did you put in httpd.conf the lines that map .php files to the php module?

If you did, did you restart apache?
     
SS3 GokouX  (op)
Dedicated MacNNer
Join Date: Jul 2001
Location: The Land of More :(
Status: Offline
Reply With Quote
Aug 27, 2001, 10:42 PM
 
Uhh... Alright, I won't pretend to know what just happened, but it's working now... I restarted apache again to see what would happen and it wouldn't start up. I copied httpd.conf.bak and manually added in the <font face = "courier">LoadModule php4_module libexec/httpd/libphp4.so</font> and <font face = "courier">AddModule mod_php4.c</font> (I already uncommented addtypes for PHP 4.x and it wouldn't work) that the installer added then restarted apache again and it works now.

Must have been something wrong with my config file. Oh, well, thanks for your help anyway.

"And I will rule you all with an iron fist! You! OBEY THE FIST!" -Invader Zim
     
timster
Dedicated MacNNer
Join Date: Oct 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Aug 28, 2001, 02:54 PM
 
Apache probably wouldnt restart due to a bad configuration file. One thing you can do is run

/path/to/apachectl configtest


this will have apache read the configuration file (httpd.conf) and then let you know if it is valid or not. And it usually gives you an clue where the error is occuring if its not valid, so you can check it out.

Mabye you want to try to find out what was wrong with your old httpd.conf. I usually redo things to get things working, THEN try to figure out what went wrong, because its invaluable for learning how it all works and helps a lot in the long run.

Good luck with PHP. Its a cool program.

-tim
     
SS3 GokouX  (op)
Dedicated MacNNer
Join Date: Jul 2001
Location: The Land of More :(
Status: Offline
Reply With Quote
Aug 29, 2001, 04:22 PM
 
I'll be sure to try that if anything like this ever happens again. Hopefully it won't though. I'm really liking PHP, nice and fast, plus a lot easier to understand than cgi and perl scripts.

"And I will rule you all with an iron fist! You! OBEY THE FIST!" -Invader Zim
     
   
 
Forum Links
Forum 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
Top
Privacy Policy
All times are GMT -4. The time now is 12:02 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,