LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 05-02-2010, 06:51 PM   #1
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Rep: Reputation: 32
PHP5 and Apache2 parsing code but no output


I have apache 2.2.3 installed with php5 and libapache2-mod-php5. The server displays web-pages fine, but when I try to load a .php file, nothing shows up. There aren't any errors, not in the browser and not in the Apache2 error logs... just nothing shows up. When I look at the page source on the browser, all the HTML code is there, but all the PHP code is gone, as though it was parsed. I can't get any output to show up though, echo and print both do nothing.

What could be the problem?

Example:
Code:
<html>
<body>
<?php
    echo 'Test!';
?>
</body>
</html>
Will output to the browser:
Code:
<html>
<body>
</body>
</html>
See, the PHP code is gone, but nothing is displayed on the browser.
 
Old 05-02-2010, 07:04 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Is the php module loaded in httpd.conf ?
does the standard test with phpinfo(); work ?

Last edited by smoker; 05-02-2010 at 07:35 PM.
 
Old 05-02-2010, 07:59 PM   #3
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Original Poster
Rep: Reputation: 32
Yes the module is loaded and phpinfo(); doesn't display anything just like "echo" and "print"... it just gets discarded from the document source... bye bye.
 
Old 05-02-2010, 08:14 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,763

Rep: Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719
Check the httpd logs for errors.
Make sure the permissions for your php pages are 644.
 
Old 05-02-2010, 08:30 PM   #5
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Original Poster
Rep: Reputation: 32
Thanks for your help smoker and michaelk. I figured it out. Everything was configured properly... you wouldn't believe it, but my FTP Client was transfering in ASCII Mode and mangled the file... It is working great now in binary mode.

Thanks for your replies!

Wyatt
 
Old 05-03-2010, 05:15 AM   #6
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
but html and php are ascii ?!?
 
Old 05-03-2010, 04:37 PM   #7
thePiet
LQ Newbie
 
Registered: Dec 2009
Posts: 25

Rep: Reputation: 15
Damn FTP

Just SCP / rSync the stuff to your server next time
 
Old 05-03-2010, 08:32 PM   #8
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Original Poster
Rep: Reputation: 32
Wink

Hah... I know. I am not sure if it was notepad or wordpad or the FTP. I Hate windows and hate both (notepad and wordpad)... ick... but I am stuck with MS for now as I am on my dads computer. *sigh*

Thanks for your help anyways guys.
 
  


Reply

Tags
resolved


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 and php5 barrythai Mandriva 2 05-08-2007 08:09 AM
apache2 not parsing .php file? rlee923 Linux - Software 20 04-08-2007 08:52 PM
Debian / Apache2 / PHP5 / Firefox not parsing locally Garybtx Linux - Server 2 11-13-2006 06:57 PM
Apache2 and PHP5 rul3r Slackware 7 09-11-2005 05:21 PM
Apache2 + PHP5.0.3 24jedi *BSD 1 07-21-2005 03:07 PM


All times are GMT -5. The time now is 07:28 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 Google+: linuxquestions
Open Source Consulting | Domain Registration