作者:linlidai911_729 | 来源:互联网 | 2023-06-21 09:33
SoIveinstalledLAMPonanUbuntumachineforsomephpdevelopmentandeverythingisworkingfine
So I've installed LAMP on an Ubuntu machine for some php development and everything is working fine except instead of parsing and displaying php pages, the browser is asking me if I want to download them. I know this is a well documented issue, and I've already been to the Ubuntu page concerning it, and gone through all the potential causes. I've installed libapache2-mod-php5
and upon running sudo a2enmod php5
I get module php5 already enabled
. So I think I've pretty much narrowed the problem down to a php file authorizations issue.
我在Ubuntu机器上安装了LAMP进行一些php开发,除了解析和显示php页面之外,一切都运行良好,浏览器会问我是否要下载它们。我知道这是一个有很好的文件记录的问题,我已经到过Ubuntu页面关于它,并经历了所有潜在的原因。我已经安装了libapache2-mod-php5,运行sudo a2enmod php5后,我已经启用了php5模块。我想我已经把问题缩小到php文件授权问题。
Now I should point out that this only happened after I modified the config file to allow a UserDir
in my /home/public_html
. With the default configuration in folder /var/www
php files parsed just fine, and still do, so long as I gave myself root access or modify their permisssions. And I didn't change anything else in the config file.
现在我要指出的是,这只有在我修改了配置文件以允许在/home/public_html中使用UserDir之后才会发生。对于/var/www php文件中的默认配置,只要我给自己根访问权限或修改它们的permisssions,就可以很好地解析,而且仍然可以。我没有改变配置文件中的其他内容。
So, my question is, how do I check/modify the php authorization files? Where are they? What exactly do I check? I can't seem to find any good info on this.
我的问题是,如何检查/修改php授权文件?他们在哪儿?我到底要检查什么?我在这方面似乎找不到任何好的信息。
4 个解决方案