Difference between revisions of "Change File Permissions with PHP"

From Phoenix Cart User Guide
Line 14: Line 14:
 
[[File:notepadplusplus.png|link=|1500px]]
 
[[File:notepadplusplus.png|link=|1500px]]
 
</div>
 
</div>
 +
  
 
*Copy and paste the following code into the new file.
 
*Copy and paste the following code into the new file.
 +
*Ensure the root path of your website is correct i.e. the path before '''/includes/configure.php'''
 +
The correct root path for your website can be found in the back up copy of the '''configure.php''' file.
 
  <?php
 
  <?php
  chmod("/var/www/vip9/sites/vip3201957/httpd/htdocs/clean/admin/includes/configure.php", 0444);
+
  chmod("/var/www/xxxx/xxxx/xxxx/xxxx/htdocs/yoursite/youradmin/includes/configure.php", 0444);
 
  echo "file permission was changed";
 
  echo "file permission was changed";
 
  ?>
 
  ?>
 +
 +
*In '''Notepad++''' go to menu '''File''' and click '''Save as...'''
 +
*Save the file in the root folder/directory (e.g. '''catalog''') of your website backup folder/directory with the name e.g. '''filepermission''' and choose '''.php''' from the '''All types(*.*)''' drop down menu.
 +
*Using FTP file transfer software e.g. FileZilla, upload this file to the root folder/directory.
 +
*In your web browser, enter '''yoursite/filepermission.php''' to run the file.
 +
*If successful, the text '''file permission was changed''' will show.
  
 
<hr>
 
<hr>
 
{{Page_In_Progress}}
 
{{Page_In_Progress}}
 
{{Contribute}}
 
{{Contribute}}

Revision as of 15:13, 9 November 2019

<historylink type="back">🠈 Back</historylink> 🠉 FAQS TIPS & TRICKS


  • There are 2 configure.php files, ensure both have their file permissions changed.
    • Important: includes/configure.php and youradmin/includes/configure.php are different files in different locations, never open both at once to avoid confusion and ensure they are uploaded/saved back to the correct locations.
  • Set file permissions for these 2 files to 444 dependent on server host. This can be done in your host server account control panel or using FTP software e.g. using FileZilla, click file, right click, select File permissions...
    • Important: Some servers do not allow file permissions to be changed to 444.
    • In this case the file permissions must be changed by creating a php file to change them.
  • Open php file editing software e.g. Notepad++ to see this:

Notepadplusplus.png


  • Copy and paste the following code into the new file.
  • Ensure the root path of your website is correct i.e. the path before /includes/configure.php

The correct root path for your website can be found in the back up copy of the configure.php file.

<?php
chmod("/var/www/xxxx/xxxx/xxxx/xxxx/htdocs/yoursite/youradmin/includes/configure.php", 0444);
echo "file permission was changed";
?>
  • In Notepad++ go to menu File and click Save as...
  • Save the file in the root folder/directory (e.g. catalog) of your website backup folder/directory with the name e.g. filepermission and choose .php from the All types(*.*) drop down menu.
  • Using FTP file transfer software e.g. FileZilla, upload this file to the root folder/directory.
  • In your web browser, enter yoursite/filepermission.php to run the file.
  • If successful, the text file permission was changed will show.

Construction.png
This page is in progress
Please visit again soon for additions and changes

Phoenix Cart User Guide, like CE Phoenix Cart, is free to use but is maintained by unpaid volunteers.

Code references are licensed under a Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales License.
All other content is the reserved Intellectual Property and Copyright of phoenixcart.org