I have some php scripts that dump certain data to disk so that a user can later, optionally, download them. This worked fine on my local development machine but is not working on my DigitalOcean droplet.
Boiled down, the code looks like
<?php file_put_contents("./onedot.txt" , "?"); file_put_contents("../twodots.txt" , "?"); file_put_contents("./pro/dotslashpro.txt" , "?"); file_put_contents("/slash.txt" , "?"); echo 'tried it'; ?>
The code runs but none of these files get created
an alternate implementation based around fopen() and write() resulted in a “can’t open file” error.
I presume there is some setting in Apache or in Debian that I need to change. Any suggestions?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $200 of credit to try our products over 60 days!