InMotion Hosting Support Center

file_get_contents() function in PHP is not working


InMotionFans
n/a Points
Asked:
2016-03-02 11:38 pm EST

Hits: 6,446
In my PHP code, I used file_get_contents() function for a long time and it used to work without any problem. But it stopped working recently. I'm wondering why this function has stopped working on my hosting recently?

You must login before you can ask a follow up question.

You must login before you can submit an answer.

OTHER ANSWERS

0

John-Paul
Staff
31,633 Points
2016-03-03 11:35 am EST
Hello,

Thank you for contacting us about an issue with the file_get_contents PHP function. Ensure you have enabled PHP error logging/reporting.

Check you are using PHP 4 >= 4.3.0, PHP 5, PHP 7.

Also, make sure you syntax is correct, and none of the parameters have changed.
file_get_contents(path,include_path,context,start,max_length (from w3schools)

Can you provide a link to the scripts for testing?

If you have any further questions, feel free to post them below.

Thank you,
John-Paul

You must login before you can post a comment about this answer.

Thanks Paul. The problem is probably due to a bug in PHP 5.4 of inmotion. We updated PHP5.4 to PHP 5.5 and the problem is fixed.
hajir
3 Points
2016-03-05 4:02 pm EST
Like this Question?

Forum Login

You are NOT logged in. You can still browse our Support Center.

To participate within our Community Support Forum:

Need more Help?

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!