php - File not being created even though write permissions exist -


i followed selected answer in this question, trying export in memory variable .php file. later require_once php file made.

the problem php file never being made. when try require it, error (http 500 code depends on 1 variable , because file not exist).

the error log says file can not required because there no such file or directory.

the dir trying make file in has 755 permissions.

here code using export variable file:

$variable_export = var_export($elasticaobject, true); $variable = "<?php\n\n\$$elasticaobject = $variable_export;\n\n?>"; file_put_contents('theindex.php', $variable); 

any idea doing wrong , why file theindex.php not being made?

your mode may insufficiant.

755 = rwx (owner), rw (group , others).

group , others may read , cross folder.

that issue if user launch php not owner of folder.

try chown user:group on folder, php-user (probably webserver) write in it.

cheers,

k.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -