aj-techsoul / ELECTRON-4-PHP

An easiest way to use php in electron
MIT License
202 stars 46 forks source link

Writing files #8

Closed andreysamode closed 5 years ago

andreysamode commented 5 years ago

Hello,

Thanks for writing this module. I'm running this on OS X and I can't seem to be able to write to a file using PHP. I can read successfully, however. Here is my write function: $path = check_path($dir.$file); if (!is_dir($path)) { $content = file_get_contents('php://input'); file_put_contents($path, $content); echo "1"; } else { echo "0"; } exit(); This works fine on Apache/PHP through a browser, but not in Electron. Does file_put_contents work for you? Any thoughts on how I can troubleshoot this?

Thanks again, Andrey

andreysamode commented 5 years ago

It was a permission issue. The files had 775 with www-data as group. Changed to 777 and it writes fine.