Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 02-04-2007, 05:06 PM   #1
LQ Newbie
Registered: Feb 2007
Posts: 8

Rep: Reputation: 0
PHP5 Fatal Error Message


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:

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.

Old 02-04-2007, 09:32 PM   #2
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:

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

# 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, 09:47 AM   #3
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!


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-28-2008 11:41 PM
Strange Repeating Error message in /var/log/message lucktsm Linux - Security 2 10-27-2006 08:29 AM
FATAL: at boot message. ekdya Debian 5 09-18-2006 02:00 AM
Sound Server Fatal Error: Error - artsmessage: /tmp/mcop-root is accessible owned... m07hm4n Linux - Software 1 08-14-2006 01:01 PM
cron.daily mails fatal error message in fedora core 2 jordanthompson Linux - Software 4 12-22-2004 07:07 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:13 PM.

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