您的位置:首页 > 编程语言 > PHP开发

新手入门php遇到的问题

2017-09-13 11:39 337 查看
最近在学习php,新手的我遇到各种各样的问题,将问题和解决方法一一列出来,希望能帮到大家。
我没有用WAMPServer集成安装包,而是单独安装apache2.4+php7.1.9+mysql5.5(历史遗留)。
按照网上的教程安装好后配置httpd.conf,成功跑起第一个页面。
由于apache默认的项目根目录是htdocs,感觉不是很方便,于是想配置多跟根目录,那么问题来了。
由于以前没接触过apache和php,首先遇到的问题是配置Directory时遇到了问题:


<Directory "E:/phpworkspace">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>


重启的时候报错了:
Invalid command '\xa1\xa1\xa1\xa1Order', perhaps misspelled or defined by a module not included in the server configuration


解决方法:

所以这里要注意在Apache2.4的安装中,如果要在文件中添加授权所有权限的命令,要使用:

Require all granted

而不是:

Order allow,deny

Allow from all

同意的道理,如果是禁止所有权限要使用:

Require all denied

而不是:

Order deny,allow

Deny from all

问题:



上图中标记的DocumentRoot看起来是一样的,但是使用注释的那行却报错:

Invalid command'\xa1\xa1\xa1\xa1ServerName',perhaps misspelled or defined by a module not included in the server configuration


解决办法:检查是不是使用了全角字符。哈哈…哈哈…哈……
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  php apache