[RESOLVED] PHP Scripts not running on web server[URGENT]
Hello everybody,
I have successfully uploaded my php/MySql website on the hosting server. Previously the site was running on some other server, and now I have transferred it to 1and1.
The problem is I am unable to run php scripts. If .php file contains simple html, its executed, but if it contains php code, I receive page cannot be displayed error. However, if in the same file I disable php scripts, it runs.
Make sure the PHP file has execute permissions, make the permissions on your php files the same as on test.php (which works) or use 755 which is a good value.
Use your hosting admin software (e.g. Cpanel/DirectAdmin) or an FTP client. 755 is an octal permissions value used on Unix-based servers. If your server is Windows based I'm not sure how you do it remotely.
Turn off friendly HTTP error messages in Internet Exploerer by going to Tools->Internet Options->Advanced. This will tell you the exact error your pages are producing. Most probably a 500 error.
If it is a 500 error, you will need to find out what part of your script is causing the PHP interpreter to fall over. Pick a script and insert a line as follows:
Code:
die('here');
This will kill the script and print 'here', mor importantly if this occurs before the interpreter crashes you won't get a 500 error. Keep moving this line down in your script until you find the line which causes it to fall over.
Eventually you'll finsd the line which is causing the problem, if it is not immeadiatly apprent why its happening post here and let us take a look.
I also notice that asp style tags are turned off, you are not using these are you. I.e:
If it is a 500 error, you will need to find out what part of your script is causing the PHP interpreter to fall over. Pick a script and insert a line as follows:
The issue has been resolved. Basically an include file was redirecting http:// to https:// and those pages who do not include the file were running. I commented out the code and site is up now.