ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Hi Guys, I'm new to these forums so apologies if I've not posted this in the correct section.
We have a server used for hosting customers websites, we currently have PHP Version 4.3.10 installed on the server. We currently have an issue that is preventing PHP from functioning. Recently, when we upload PHP files onto the server and attempt to run them all we get back is a blank screen. No output whatsoever, as if PHP isn't parsing the code whatsoever, or it is and just isn't generating an output.
One of the websites in question is working perfectly on another hosting server, yet when we try and run it on this server it just does the above, with absolutely no reason whatsoever. We do have other sites that appear to be working fine with PHP, however these were the first sites created on the server and may not be subject to the same issues that recent sites are having, however i'm not sure if this is the case.
The site mentioned above is php and also connects to a MySQL database for data.
Whats baffling me is that it used to work, and suddenly it has stopped working but its causing major disruption for sites on the server.
If anyone can help with this problem i'd really appreciate it.
Well first of all .. make a page whatever.php with the contents
Code:
<?php
echo "Hello";
?>
Upload this one .. if it works .. php also works
My advice is to check your php.ini .. check for error reporting .. I think there is some fatal eror in the script .. php kills the script .. and the error is logged instead of being outputed on the browser. So check error_repporting and display_errors in php.ini.(Also check you apache logs)
you can check the error log files in your hosting, which will tell u correctly whats is the problem, is it with the directory permissions error, or with the php script which you have writeen
further u can create a php file with the follwing code and upload to your hosting server.
<?php
phpinfo();
?>
call the file it will clearly describe if any function of PHP has been disabled by the hosting server, and other PHP info will be displayed. it would help u for other purpose also
thanks for all your posts and apologies for the delay in replying back to you all.
I tied the phpinfo file and everything worked fine, so I started to look elsewhere.
I enabled show_errors in the php.ini file which ultimately displayed the errors that were causing the pages to display blank. Although I don't think PHP is working correctly, enabling the error reporting has allowed me to diagnose errors and rectify them.
Are there any major security implications to display the errors?
thanks for all your posts and apologies for the delay in replying back to you all.
I tied the phpinfo file and everything worked fine, so I started to look elsewhere.
I enabled show_errors in the php.ini file which ultimately displayed the errors that were causing the pages to display blank. Although I don't think PHP is working correctly, enabling the error reporting has allowed me to diagnose errors and rectify them.
Are there any major security implications to display the errors?
regards
Danny
On public webservers, showing errors may not be desirable since it can show outsiders sensitive details about your setup or files on your server.
Although I don't think PHP is working correctly, enabling the error reporting has allowed me to diagnose errors and rectify them.
If you can see the errors and rectify them then does it not follow that the errors were in your code? Why do you suspect PHP isn't working correctly?
Quote:
Are there any major security implications to display the errors?
On a production or publically available website it is highly recommended to log the errors rather than display them in the browser window. You can set this up in php.ini, and as Wim Sturkenboom mentioned they will appear in your apache error_log.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.