Home > Backend Development > PHP Tutorial > nginx - php linux virtual directory

nginx - php linux virtual directory

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-09-11 11:34:14
Original
1062 people have browsed it

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.

Reply content:

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.

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template