PHP file_put_contents not writing to local file

Hi,

I just want to know if I'm doing something obviously dumb or I'm missing something. I have a very simple script set up to collect email addresses from a form, and initially I had the script writing to a local file. However, no output appears in the file.

File permissions appear fine, the output file is outside the doc root directory, and the script otherwise runs fine. What could be wrong?

Thanks!

Simon

3 Replies

"I had the script writing to a local file"

Do you mean the script was working while you developed it and now that it is invoked from the web server it doesn't work, or do you mean that it was working from the web server and now it's suddenly stopped?

M

Hi,

It was working on my local machine under my MAMP server (which I use for development), but not when I transferred it to my linode instance.

Thanks

Check your web server error logs, php errors often get dumped there, also check your php.ini settings is open_basedir restricting access?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct