Apache Webserver - How to write to dir/files with permissions set at 755 instead of 777

前端 未结 3 1357
旧巷少年郎
旧巷少年郎 2021-02-03 15:39

I just learned to install Apache 2 on my ubuntu linux localhost for the first time. I\'m making it work with PHP5.

I noticed that anytime I want to write to a file or d

3条回答
  •  天涯浪人
    2021-02-03 16:31

    First, you will want to find out as which user your PHP code is running. If you are using mod_php5 (package name libapache2-mod-php5) with Apache to run with the "worker" or the "prefork" MPM, this will probably be www-data.

    This is no big problem as long as you only run one web application within the server. However, if you run multiple applications (or scripts that are owned by more than one user), you are setting yourself up for all kinds of security-related "fun".

提交回复
热议问题