Search
 
SCRIPT & CODE EXAMPLE
 

PHP

You need to grant write permissions for PHP on the following directory: /var/www/html/prestashop

3 STEP SOLUTION for PHP WRITE PERMISSIONS ISSUE CentOS 8 / RHEL 8 - NGINX / Prestashop
-----------------------------------------------------------------
Step 1: Determine PHP User

Create a PHP file containing the following:

<?php echo `whoami`; ?>
Upload it to your web server. The output should be similar to the following:

apache
  
Therefore, the PHP user is "apache" (or "www-data" in some cases)

-----------------------------------------------------------------
  
Step 2: Determine Owner of Directory

Next, check the details of the web directory via the command line:

ls -dl /var/www/example.com/public_html/example-folder
The result should be similar to the following:

drwxrwxr-x 2 exampleuser1 exampleuser2 4096 Mar 29 16:34 example-folder
Therefore, the owner of the directory is exampleuser1.
  
-------------------------------------------------------------------

Step 3: Change Directory Owner to PHP User

Afterwards, change the owner of the web directory to the PHP user:

sudo chown -R www-data /var/www/example.com/public_html/example-folder
Verify that the owner of the web directory has been changed:

ls -dl /var/www/example.com/public_html/example-folder
The result should be similar to the following:

drwxrwxr-x 2 www-data exampleuser2 4096 Mar 29 16:34 example-folder
Therefore, the owner of example-folder has successfully been changed to the PHP user: www-data.
 
Comment

PREVIOUS NEXT
Code Example
Php :: wordpress convert object to array 
Php :: php json decode 
Php :: laravel hide columns 
Php :: php infinite loop 
Php :: dump all variable in view codeigniter 
Php :: custom blade if directive 
Php :: toast in laravel 
Php :: Error : Call to undefined method IlluminateNotificationsChannelsMailChannel::assertSentTo() 
Php :: php array remove empty values recursive 
Php :: wordpress filter category from widget 
Php :: php dar echo em um stdClass 
Php :: php object example 
Php :: redirect to intent url after login laravel 
Php :: php warning array to string conversion 
Php :: php.validate.executablepath docker 
Php :: eloquent search ignore case 
Php :: set config key dynamic laravel 
Php :: laravel route limit parameter 
Php :: dynamic function name php 
Php :: laravel 8 livewire tutorial 
Php :: php print html code 
Php :: how to empty an array in php 
Php :: extend multiple classes in php 
Php :: what is the use of migration file in laravel 
Php :: php undefined offset 
Php :: laravel best practices 
Php :: laravel link to css or image 
Php :: how to get private images in s3 laravel 
Php :: string function in php 
Php :: indexing in database laravel 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =