新手入門php遇到的問題

來源:互聯網
上載者:User
最近在學習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
解決辦法:檢查是不是使用了全形字元。哈哈…哈哈…哈……

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.