Jump to content

Archived

This topic is now archived and is closed to further replies.

saberhagen

PHP script works on remote host but not locally

Recommended Posts

I\'ve just installed Apache, PHP and MySQL on Windows ME using phpdev423. This is intended to be for local development and testing of php scripts without having to upload them to my webspace.

 

The test scripts which come with phpdev work fine. I downloaded the bbclone counter script from http://bbclone/tuxfamily.org and this works on my hosted webspace (at www.thepsychoticreaction.co.uk) with no problems, but won\'t work on my local apache server! The install script works, and I can also install it manually, but when I try to use the counter, the script refuses to work. There are no errors appearing in the apache error log for this, but the output source says it is unable to use or access one of the required files.

 

I wondered if this might be to do with file permissions, but I was under the impression that php scripts don\'t need permissions set. Do permissions need to be set if they access other files, and if so, how do I set permissions on a local apache server?

 

I also tried putting php scripts in the cgi-bin directory as I assumed this would have permissions set on it, but this makes things worse. If I try to run a php script in the cgi-bin it gives me internal server error, and the apache error log says there is a bareword or syntax error in the code. It appears to be trying to execute all the html as a script, but commenting out the scriptalias directive in the httpd.conf doesn\'t seem to make any difference.

 

I can\'t work this out at all - help please. I don\'t want to go any further with downloading or writing php scripts until I know that my local server is going to work properly. At the moment the situation is the opposite of what I intended - I have to upload scripts to my webspace to see if they work, then put them on my local apache to see if that works and then try to figure out why it doesn\'t...

Share this post


Link to post
Share on other sites

I\'d take a quick guess that your php.ini files on each host are different. Maybe globals are set to \'ON\' on one host and \'OFF\' on the other.

Share this post


Link to post
Share on other sites

It seems to be an issue with Windows ME as I\'ve just tried the same thing on my new laptop with XP pro and it works perfectly! It could also be because I had another version of PHP installed on my ME desktop but I got rid of it before I installed phpdev. Anyway, I\'m happy...

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.