简体   繁体   English

Ubunutu的Apache2中的PhP Cake应用程序无法正常工作,但可以在窗口的沼泽中找到

[英]PhP Cake app in Apache2 in Ubunutu not working but working find in window's wamp

I have a web application that is writen in php using cake framework. 我有一个使用Cake Framework用php写的Web应用程序。 In windows environment i use wamp and it works find if i enbale apache read_write. 在Windows环境中,我使用wamp,它可以找到我是否启用apache read_write。 Then I shift to use Linux environment Ubuntu 15. I have installed apache2 already and php too. 然后我转向使用Linux环境Ubuntu15。我已经安装了apache2和php。 it is all work. 这都是工作。 But when I put my app in /var/www in ubuntu and open the web page it said that the require_once function cannot file the location of the file. 但是,当我将应用程序放在ubuntu的/ var / www中并打开网页时,它说require_once函数无法归档文件的位置。

I already change the owner of the www/* to www-data already, but it is still not work. 我已经将www / *的所有者更改为www-data,但是仍然无法使用。 mod_readwrite of apache is also enabled. apache的mod_readwrite也已启用。 So I want to know how could I enable read_write in Lamp like in wamp that I did on window? 所以我想知道如何像在窗口中的wamp中那样在Lamp中启用read_write? I met the same error in window if I don't enable it. 如果不启用它,我会在窗口中遇到相同的错误。 So think it is the problem. 所以认为这是问题所在。 Can anyone help me to solve this problem? 谁能帮我解决这个问题?

One thing you will want to check for is that you're using the proper directory separator in any paths you're using for your require statements (this can be done by using the DIRECTORY_SEPARATOR constant in place of hard coded slashes in your paths) 您需要检查的一件事是,在用于require语句的任何路径中都使用了正确的目录分隔符(这可以通过使用DIRECTORY_SEPARATOR常量代替路径中的硬编码斜杠来完成)

Another thing you will want to do is look at the apache configuration for each environment and ensure that they are the same. 您要做的另一件事是查看每种环境的apache配置,并确保它们相同。 In particular check to ensure that your virtual hosts are defined correctly. 特别要检查以确保正确定义了虚拟主机。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM