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 > Panther PHP Troubles?

Panther PHP Troubles?
Thread Tools
RGB
Mac Elite
Join Date: Jan 2002
Location: College in the Land of Oz
Status: Offline
Reply With Quote
Nov 6, 2003, 03:42 AM
 
PHP on my webserver is a vital component of my work, so enabling PHP was one of the first steps I took after an Archive and Install of Panther last weekend. After uncommenting the lines in httpd.conf did not work, I put httpd.conf back to it's installed state, and Installed Mark Lyniage's PHP installation. Still, no luck, PHP is not getting processed on my server.

Has anyone else had difficulty, or at least know what I can do to fix this?

As always, thanks in advance.
     
MickS
Senior User
Join Date: Sep 2000
Location: In a maze of twisty tunnels all alike
Status: Offline
Reply With Quote
Nov 6, 2003, 05:48 AM
 
Originally posted by RGB:
Has anyone else had difficulty, or at least know what I can do to fix this?
Look in the log file /var/log/httpd/error_log that should point out the errors.

I installed Mark Lyniage's PHP package and this didn't work straight away. It appeared that the Apple supplied PHP module was being loaded. I added the line:

LoadModule php4_module /usr/local/php/libphp4.so

Before the commented out line in /etc/httpd/httpd.conf and removed the lines added by the package installer towards the end of this file. I now have PHP running connecting to both MySQL and PostgreSQL databases on my Powerbook.
     
Mafoo
Junior Member
Join Date: Jun 1999
Location: England
Status: Offline
Reply With Quote
Nov 6, 2003, 10:22 PM
 
go to the /etc folder and rename the php.ini.default to php.ini

Open it in your favourite text editor and change register global variables to on.

Save and restart apache (re edit the httpd.conf file as well)

This fixes it for me.

-Mafoo
     
torifile
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Nov 7, 2003, 12:47 AM
 
I haven't had any problems at all. I didn't install the entropy.ch packages. All I did was uncomment the php lines in the addmodule and loadmodule sections and add 2 lines to the addtype section. Did you remember to do that?

Code:
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
     
RGB  (op)
Mac Elite
Join Date: Jan 2002
Location: College in the Land of Oz
Status: Offline
Reply With Quote
Nov 7, 2003, 10:55 AM
 
Originally posted by torifile:
I haven't had any problems at all. I didn't install the entropy.ch packages. All I did was uncomment the php lines in the addmodule and loadmodule sections and add 2 lines to the addtype section. Did you remember to do that?

Code:
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
IfModule mod_php4.
# If php is turned on, we repsect .php and .phps files.
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
__

Already in there. I'll try the method mentioned above.
     
RGB  (op)
Mac Elite
Join Date: Jan 2002
Location: College in the Land of Oz
Status: Offline
Reply With Quote
Nov 7, 2003, 11:00 AM
 
Originally posted by Mafoo:
go to the /etc folder and rename the php.ini.default to php.ini

Open it in your favourite text editor and change register global variables to on.

Save and restart apache (re edit the httpd.conf file as well)

This fixes it for me.

-Mafoo
This did the trick. Thank you thank you thank you
     
bonk
Junior Member
Join Date: Apr 2001
Location: Middle / East TN
Status: Offline
Reply With Quote
Nov 7, 2003, 11:59 AM
 
Originally posted by Mafoo:
Open it in your favourite text editor and change register global variables to on.

-Mafoo
Um, I dunno why you would need those on, it's just a security risk. Either way it wouldn't affect the installation, just only older PHP scripts that don't use $_POST and $_GET
Dual 500 G4 :: 576mb :: 180gb (120+40+20)
17" PB G4 1.33 gHz :: 1gb :: 80 gb @ 5400rpm
     
schk
Dedicated MacNNer
Join Date: Jan 2003
Status: Offline
Reply With Quote
Nov 7, 2003, 12:11 PM
 
Originally posted by bonk:
Um, I dunno why you would need those on, it's just a security risk. Either way it wouldn't affect the installation, just only older PHP scripts that don't use $_POST and $_GET
Seriously, if you are still coding PHP with global variables on and not using the respective $_POST and $_GET arrays to reference variables passed through forms, you should leave register globals off and update your respective scripts.
     
foamy
Senior User
Join Date: Sep 2000
Location: Shallow Alto, CA
Status: Offline
Reply With Quote
Nov 7, 2003, 02:24 PM
 
The register globals bit got me with Panther as well. I haven't had a chance to update all my scripts as of yet, but I did find the extract command got me up and running quickly so that now I can upgrade my scripts in a more leisurely fashion.

I just added the following to the top of my page template
Code:
extract($_GET); extract($_POST);
Works for now. Does anyone know if this method is inherently more or less secure than having register globals on?
     
schk
Dedicated MacNNer
Join Date: Jan 2003
Status: Offline
Reply With Quote
Nov 7, 2003, 02:30 PM
 
Originally posted by foamy:
The register globals bit got me with Panther as well. I haven't had a chance to update all my scripts as of yet, but I did find the extract command got me up and running quickly so that now I can upgrade my scripts in a more leisurely fashion.

I just added the following to the top of my page template
Code:
extract($_GET); extract($_POST);
Works for now. Does anyone know if this method is inherently more or less secure than having register globals on?
It's an easy fix to get your scripts working without turning register globals on, but it's still not any better security wise, see the comments here:

http://us2.php.net/function.extract
     
barbarian
Senior User
Join Date: Apr 2001
Location: Palo Alto, CA
Status: Offline
Reply With Quote
Nov 7, 2003, 04:11 PM
 
I'd love a simple step by step php installation guide for panther if anyone has the time.
     
schk
Dedicated MacNNer
Join Date: Jan 2003
Status: Offline
Reply With Quote
Nov 7, 2003, 05:12 PM
 
Originally posted by barbarian:
I'd love a simple step by step php installation guide for panther if anyone has the time.
If you don't have any specific requirements such as GD library, etc and just want to start out with PHP, Panther already has 4.2.3 pre-installed, just not activated. All you need to do is edit /etc/httpd.conf and uncomment two lines where it loads the php modules. Use pico or something and search for 'php' and uncomment the two lines and restart web sharing in the control panel. PHP will now be enabled.
     
torifile
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Nov 7, 2003, 05:13 PM
 
Originally posted by foamy:
The register globals bit got me with Panther as well. I haven't had a chance to update all my scripts as of yet, but I did find the extract command got me up and running quickly so that now I can upgrade my scripts in a more leisurely fashion.

I just added the following to the top of my page template
Code:
extract($_GET); extract($_POST);
Works for now. Does anyone know if this method is inherently more or less secure than having register globals on?
AFAIK, register globals was turned off for security reasons. Your method, I believe, negates that security benefit. Basically, if you're expecting some post or get data, tell it so explicitly.
     
m a d r a
Mac Elite
Join Date: Sep 2001
Location: the intarweb
Status: Offline
Reply With Quote
Nov 8, 2003, 12:33 PM
 
WTF does each upgrade of OSX have to over-ride your HTTP configuration files anyway? it's really irritating to have to fire up terminal every feckin upgrade and try and remember all the lines in all the files i have to edit to get things back to where i was
     
Wevah
Senior User
Join Date: Nov 2001
Location: State of Denial
Status: Offline
Reply With Quote
Nov 8, 2003, 09:30 PM
 
Yeah, I find it annoying too. I just force myself to back up httpd.conf (etc) before I update now. :/
[Wevah setPostCount:[Wevah postCount] + 1];
     
DVD Plaza
Senior User
Join Date: Oct 2002
Location: Adelaide, South Australia
Status: Offline
Reply With Quote
Nov 9, 2003, 08:17 AM
 
Just compile and install Apache & PHP into /usr/local and OSX will never touch it again.
     
   
 
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 05:48 PM.
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.,