linux服务器上的路径设置

瓦卡斯·拉娜(Waqas Rana)

我有在window上完美运行的php项目。

现在我正在Centos Linux Server上部署项目。

define('INCLUDES_PATH', ROOT_PATH.'cms-includes/');
ini_set('include_path',INCLUDES_PATH.':'.ini_get('include_path'));

所以INCLUDES_PATH->C:\xampp\htdocs\cms-includes

我在Linux上面临一个路径问题。在Linux中,我的项目位置是/var/www/web_loan/xampp/htdocs\...cms-includes

现在存在为设置路径的问题C:\由于C:\服务器上没有位置,我该如何在Linux中执行此操作

我应该提供哪种类型的路径?

错误看起来像这样

Fatal error in line 15 of file/var/www/web_loan/xampp/htdocs/cms-includes/init.inc.php
- require_once(INCLUDES_PATHpear.mysql.php): failed to open stream: No such file or directory

PHP Fatal error:  require_once(): Failed opening required 'INCLUDES_PATHpear.mysql.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/web_loan/xampp/htdocs/cms-includes/init.inc.php on line 15.

LINE#15看起来像 init.inc.php

require_once(INCLUDES_PATH . 'pear.mysql.php');

我应该根据Linux中的定义INCLUDES_PATHdefines.inc.php吗?

Paxamus

首先,确认文件在那里。在命令提示符下,键入:

ls -l /var/www/web_loan/xampp/htdocs/cms-includes/init.inc.php

这也应该向您显示文件的所有权。确保运行apache的用户可以读取此文件。通常,该用户为www-data如果没有,请运行以下命令:

chown www-data:www-data /var/www/web_loan/xampp/htdocs/cms-includes/init.inc.php

尝试在require语句中给出绝对路径

require_once('/var/www/web_loan/xampp/htdocs/cms-includes/pear.mysql.php');

如果这有效,则可能是常量变量未正确定义。

编辑:chown不是chmod

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章