LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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
  Search this Thread
Old 02-04-2007, 06:06 PM   #1
geoffmat
LQ Newbie
 
Registered: Feb 2007
Posts: 8

Rep: Reputation: 0
PHP5 Fatal Error Message


Hello,

I have searched the forum so I hope this is not a repeat post. I am new to this and just installed OpenSUSE 10.2 and had the install program go ahead and install MySQL and PHP5 as well. When I run the "PHP Test" file that comes with it everything works great (even if I change the extension from .php5 to .php). However, when I tried my own test:
<?php

echo "If this works, we <i>really</i> did it!";

?>

and saved this as "phptest.php" I received the following error:

Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 Fatal error: Unknown: Failed opening required '/srv/www/htdocs/phptest.php' (include_path='.:/usr/share/php5:/usr/share/php5/PEAR') in Unknown on line 0

I looked at the aforementioned directories and they appear to all have the "755" permissions. I also tried renaming the file to .php5 and it worked (??). But f I put HTML (i.e. <TITLE>PHPTest</TITLE> with appropriate added tags, it gives me the same error again.

I am running Apache 2, if that helps. My guess is there is some configuration I need to change somewhere. Anyone have any ideas?

Sorry for the long post.

Thanks
Geoff
 
Old 02-04-2007, 10:32 PM   #2
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
If using the extension .php5 works but .php doesn't then I suspect that it is an apache error. You will need to modify the httpd.conf script (or a configuration file called by this script -- sorry I don't know how it is set up in SUSE) The lines you want to look for are as follows:

Code:
# Load php - you should have this since .php5 works
LoadModule php5_module modules/libphp5.so

# Cause the PHP interpreter to handle files with a .php extension.
AddHandler php5-script .php
AddType text/html .php

# Add index.php to the list of files that will be served as default
DirectoryIndex index.php
 
Old 02-05-2007, 10:47 AM   #3
geoffmat
LQ Newbie
 
Registered: Feb 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Thank you

It looks like that worked, although I am frustrated because I am not completely sure why ;-)

It said the module was already included, so I commented that piece out but left the other lines in.

Thanks again!
Geoff
 
  


Reply

Tags
apache2, errors, php5


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
scp does not work and gives the following error message: scp: FATAL: Executing ssh1 i akay Linux - Networking 16 09-29-2008 12:41 AM
Strange Repeating Error message in /var/log/message lucktsm Linux - Security 2 10-27-2006 09:29 AM
FATAL: at boot message. ekdya Debian 5 09-18-2006 03:00 AM
Sound Server Fatal Error: Error - artsmessage: /tmp/mcop-root is accessible owned... m07hm4n Linux - Software 1 08-14-2006 02:01 PM
cron.daily mails fatal error message in fedora core 2 jordanthompson Linux - Software 4 12-22-2004 08:07 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration