PDA

Click to See Complete Forum and Search --> : [RESOLVED] PHP Scripts not running on web server[URGENT]


usamaalam
Mar 31st, 2006, 05:54 AM
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.

Any ideas ??

Thanks.

da_silvy
Mar 31st, 2006, 06:02 AM
is your server set up to properly handle the php application type?

Perhaps the php parser isn't working properly

usamaalam
Mar 31st, 2006, 06:11 AM
Here is the PHP info the server.

www.rxclubamerica.com/test.php

penagate
Mar 31st, 2006, 09:25 PM
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.

usamaalam
Apr 1st, 2006, 02:48 AM
How can I check permissions on hosting server and what is 755 and how to set it?

Thanks.

penagate
Apr 1st, 2006, 02:49 AM
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.

usamaalam
Apr 1st, 2006, 02:53 AM
My server is Unix-based.

Thanks.

visualAd
Apr 1st, 2006, 06:00 AM
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:

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:

<%
echo('phpcode');
%>

usamaalam
Apr 1st, 2006, 03:12 PM
Attached image shows the error message I'm getting. I have turned off friendly error messages in Internet Explorer.

Thanks.

visualAd
Apr 2nd, 2006, 03:50 AM
Now you need to find out what is causing it.
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:

die('here');

usamaalam
Apr 4th, 2006, 08:08 AM
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.

Thanks