[英]Sqlite PHP permission issue / writing to a different folder
I have two sites running off a single box that answers on different ip addresses. 我有两个站点运行在一个可以在不同IP地址上回答的盒子上。
Both of these sites have different root folders /var/www/
and /var/www2
. 这两个站点都有不同的根文件夹
/var/www/
和/var/www2
。
/var/www
contains the main site and a sqlite database. /var/www
包含主站点和一个sqlite数据库。
/var/www2
contains a few scripts that need to access that same db. /var/www2
包含一些需要访问同一数据库的脚本。
I have tried 我努力了
$db = new PDO('sqlite:/var/www/db.sqlite');
from the second site, but, I keep getting File not found
, and in the logs I get 从第二个站点,但是,我不断得到
File not found
,并在日志中得到
FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream,``
Both of these sites work fine when reading/writing to dbs in their own folder without the path. 当在没有路径的情况下读取/写入自己文件夹中的数据库时,这两个站点都可以正常工作。
Can anyone advise anything? 有人可以建议什么吗?
Well it is permission problem. 那么这是权限问题。 Site1 http server runs under site1 user and site2 under site2 user .
Site1 http服务器在site1用户下运行,site2在site2用户下运行 。
Possible solutions are: 可能的解决方案是:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.