LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 08-25-2006, 03:36 AM   #1
dannylee
LQ Newbie
 
Registered: Aug 2006
Posts: 2

Rep: Reputation: 0
Exclamation PHP not functioning correctly


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.
 
Old 08-25-2006, 05:26 AM   #2
cupubboy
Member
 
Registered: May 2003
Location: Bucharest,Romania
Distribution: Fedora Core 7
Posts: 109

Rep: Reputation: 15
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)

Cheers

Last edited by cupubboy; 08-25-2006 at 05:27 AM.
 
Old 08-25-2006, 06:27 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 9,919

Rep: Reputation: 338Reputation: 338Reputation: 338Reputation: 338
Make sure the file permissions for the php scripts uploaded are set to 644.
 
Old 08-25-2006, 06:53 AM   #4
nesargha
Member
 
Registered: May 2006
Distribution: rhel 4, red hat 9, fedora core 2
Posts: 51

Rep: Reputation: 15
yeah michaelk is correct,

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

hope this work out for u

Last edited by nesargha; 08-25-2006 at 06:54 AM.
 
Old 08-29-2006, 03:10 AM   #5
dannylee
LQ Newbie
 
Registered: Aug 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Hi Guys,

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
 
Old 08-29-2006, 03:37 AM   #6
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 70
Quote:
Originally Posted by dannylee
Hi Guys,

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.
 
Old 08-29-2006, 06:35 AM   #7
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 10.04, Crunchbang Statler
Posts: 3,325

Rep: Reputation: 168Reputation: 168
You can also check /var/log/apache/error_log. On my Slackware boxes:
Code:
tail -f /var/log/apache/error_log
tail -f /var/log/apache/error_log |grep PHP
The latter can be used to find PHP related messaged
 
Old 08-30-2006, 05:25 AM   #8
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Blog Entries: 4

Rep: Reputation: 58
Quote:
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I test that my dns server is functioning correctly adam_ant Linux - Networking 4 12-13-2005 02:31 PM
USB Not Functioning Correctly. Phoenix_Zero Linux - Newbie 3 01-08-2005 01:42 PM
DVD/CDR/CDRW drive not functioning correctly with mandrake 10 Andrew Skinner Linux - Laptop and Netbook 4 07-02-2004 02:13 PM
LILO not functioning correctly for Mandrake 8.2, Only prints "07" frogger12 Mandriva 3 05-31-2004 09:11 PM
Total newbie with stuck cursor: mouse drivers not functioning correctly HELP zaphod111 Linux - Software 2 11-06-2003 07:44 PM


All times are GMT -5. The time now is 06:44 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration