Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Thread Tools Search this Thread Rate Thread
Old 26-Jun-2016, 20:31
Richardos Richardos is offline
New Member
Join Date: May 2015
Posts: 6
Richardos is on a distinguished road

Error opening PHP file

I have a php file on my website. And I add this line of code to it:

HTML Code:
$myfile = fopen("fileName.txt", "r") or die("Unable to open file!");

But it prints out this error:

HTML Code:
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error. More information about this error may be available in the server error log.

I have looked through the server error log and found nothing. I have changed the error settings to E_ALL and looked through the logs again and found nothing. I am using Windows plesk hosting on , and I have changed the checked the boxes for file permissions for write/read/and modify. Nothing seems to work.

I appreciated your help so much. Thanks
Old 27-Jun-2016, 19:09
TurboPT's Avatar
TurboPT TurboPT is offline
Senior Member
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 1,519
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: Error opening php file

Might need a little more detail...

So, does the script work withOUT adding that line, if that is the only line added?

If so, can you add an echo or print before that line to see if it prints?

Unfortunately, the Internal Server Error [assuming http status 500] is a catch-all for many situations.
Use the the source!!
WYCIWYG -- what you code is what you get!
Old 02-Aug-2016, 17:44
vinahostsupport vinahostsupport is offline
New Member
Join Date: Jul 2016
Posts: 5
vinahostsupport is on a distinguished road

Re: Error opening php file

Dear friend,

I think your problem may come from specific reasons include :
- Your .htaccess, if your web server supports .htaccess , you should check this file.
- Your permission of file/directory you want to handle.
- Your PHP Handler that your web server hosting is using. The wrong configuration about PHP Handler can crash the operation of customer website in some cases. Please check it.
- Your source code has wrong flow code. You should check your source code, try the easy code first.

Finally, if you are using service from provider. You could contact them to resolve this issue.

Old 18-Aug-2017, 05:24
persysweb's Avatar
persysweb persysweb is offline
Junior Member
Join Date: Aug 2017
Location: India
Posts: 51
persysweb is on a distinguished road

Re: Error opening PHP file

Can you please make sure the your site is running on required PHP version?

Also, please make sure all files and directories have the correct permission set.

You will need to check the live error logs while accessing the site so they will provide you the exact cause in error logs.
Old 26-Aug-2017, 06:09
shyamdas shyamdas is offline
Account Disabled
Join Date: Aug 2017
Posts: 28
shyamdas has a little shameless behaviour in the past

Re: Error opening PHP file

I think problem in you htaccess file you should correct that first.
Old 17-Nov-2017, 03:54
onliveserver onliveserver is offline
New Member
Join Date: Jun 2017
Posts: 3
onliveserver is on a distinguished road

Re: Error opening PHP file


There are two reason behind the error.
1. .htaccess file.
2. missing php version and modules.

So check the php version and may be some of modules missing.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
#1 responsive WHMCS templates since 09 | WHMCS - Wordpress - HTML5 - PHP | Welcome Fu zomex Member Announcements, Advertisements & Offers 0 08-Jun-2016 03:29
CD burner wont burn!! robertli55 Computer Hardware Forum 1 18-Jun-2004 10:53
Yet another CD burner problem: Lite-On LSC-24082K Erwin Computer Hardware Forum 1 22-May-2004 11:28
CD Buring Failed skanth2000 Computer Hardware Forum 1 15-Nov-2003 04:52
How Do i get php to find out the file type of a file for me? viperman95833 MySQL / PHP Forum 2 08-Mar-2003 10:48

Network Sites: GIDNetwork · GIDApp · GIDBlog · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 02:45.

vBulletin, Copyright © 2000 - 2018, Jelsoft Enterprises Ltd.