Harmster Posted November 19, 2013 Posted November 19, 2013 Hey there, I am creating my GUI for my MVC PW Module. And I like to create a directory and a php file in the /site/templates folder. I am using php as the hawiaknl and the owner of the /site/templates folder is hawiaknl But i get permission denied every time I tried 755, 777 but that shouldnt matter caus I am the owner right? Maybe I am just htinking wrong, could someone help me out? (the script is executed from /site/modules/MvcModule/MvcModule.module) Like so <?php $h = fopen($path.$template->name.'.php', 'w') or die("Cannot generate controller file" . $path.$template->name); ?>
DaveP Posted November 19, 2013 Posted November 19, 2013 Is the script not more likely to be running as the Apache or php user? (Will probably depend on Safe Mode/suEXEC/php running as cgi, etc etc.)
Harmster Posted November 19, 2013 Author Posted November 19, 2013 Is the script not more likely to be running as the Apache or php user? (Will probably depend on Safe Mode/suEXEC/php running as cgi, etc etc.) Any idea how I can check this? I used posix_getpwuid(posix_geteuid()); and it showed hawiaknl
ryan Posted November 23, 2013 Posted November 23, 2013 Your best bet is to do something like this: if(!is_writable(wire('config')->paths->templates)) { $this->error("Please make your /site/templates/ dir writable to use this module."); }
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now