Home > Article > Backend Development > nginx - php linux virtual directory
PHP+CENTOS+NGINX
I want to implement cross-directory upload with PHP. For example, if we set up a virtual directory in IIS under the WIN server, then we have the permissions of that directory (only relative to this site), and can upload, delete, and access this directory.
I want to achieve this requirement under NGINX. For example, my website is under /var/www, but I need to put the pictures I uploaded under /var/pic/, and I can set an alias to access the files in this directory.
PHP+CENTOS+NGINX
I want to implement cross-directory upload with PHP. For example, if we set up a virtual directory in IIS under the WIN server, then we have the permissions of that directory (only relative to this site), and can upload, delete, and access this directory.
I want to achieve this requirement under NGINX. For example, my website is under /var/www, but I need to put the pictures I uploaded under /var/pic/, and I can set an alias to access the files in this directory.
Then you set it up. Permissions under Linux are only related to the owner and permission mode.
For example, the php-fpm process is the www-data user (the default user in Ubuntu, not necessarily this in other distributions), then as long as the www-data user has write permissions to the directory, php can write to the directory.