|
|
Panther PHP Troubles?
|
|
|
|
Mac Elite
Join Date: Jan 2002
Location: College in the Land of Oz
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Sep 2000
Location: In a maze of twisty tunnels all alike
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Junior Member
Join Date: Jun 1999
Location: England
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Jan 2001
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Jan 2002
Location: College in the Land of Oz
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Jan 2002
Location: College in the Land of Oz
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
|
Junior Member
Join Date: Apr 2001
Location: Middle / East TN
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Jan 2003
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Sep 2000
Location: Shallow Alto, CA
Status:
Offline
|
|
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?
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Jan 2003
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Apr 2001
Location: Palo Alto, CA
Status:
Offline
|
|
I'd love a simple step by step php installation guide for panther if anyone has the time.
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Jan 2003
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Jan 2001
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Sep 2001
Location: the intarweb
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Nov 2001
Location: State of Denial
Status:
Offline
|
|
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];
|
|
|
|
|
|
|
|
Senior User
Join Date: Oct 2002
Location: Adelaide, South Australia
Status:
Offline
|
|
Just compile and install Apache & PHP into /usr/local and OSX will never touch it again.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|