I have one website, not i want when i upload this site on live server it should ask for database username, password, site url..etc. Something like website installer. It is working fine in LOCAL system.
Now my problem is: i need to change RewriteBase in .htaccess file. But this file is located at root of site. So i am getting permission issue to create new file or edit/copy file which is located at root.
Warning: rename(generate.htaccess,.htaccess): Permission denied
Warning: copy(.htaccess): failed to open stream: Permission denied
What should i do. Please help.
Thanks.
Enable write permission to all of the file that you want to edit (Hold on the file – File Operations – Permission – tick all on write). That's it. You can open the file as text and edit it with Jota Text Editor now. Remember to change the permission back to previous settings after done changing.
Creating a ROOT fileUse the function Open() from TFile to create or open a ROOT file. For the second argument, the following options are available: "RECREATE" : create a ROOT file, replacing it if it already exists. "CREATE" or "NEW" : create a ROOT file.
To Create/Modify file on root directory you must have to give 0777 permission to your root directory. This is not a good practice.
I suggest create empty .htaccess or other required file with 777 permission initially. Before writing content in that file first check write permission after that copy content from source file (in your case from where you trying to copy).
Hope this may help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With