在production前最好在header中隱藏系統的版本資訊。
預設像這樣︰Apache/2.4.2 (Unix) PHP/4.2.2 MyMod/1.2
可以在apache 的httpd.conf加入以下兩個設定︰
ServerTokens Prod
ServerSignature Off
修改後只會看到︰Apache
Showing posts with label apache. Show all posts
Showing posts with label apache. Show all posts
Friday, November 9, 2018
Error: [0] BadFunctionCallException in Redis.php line 44 不支持: redis
在安裝thinkphp系統時,出現這個錯誤,原來是redis沒有放到php目錄下。
- 先在這裏下載php_redis.dll
- 然後解壓縮到php/ext/目錄中。
- 在php.ini加入extension=php_redis.dll
- 最後重啓apache就可以了。
Reference: ThinkPHP5报错php not support: redis以及Redis的使用
Error: Invalid command 'Allow', perhaps misspelled ...
在httpd-vhosts.conf中配置了目錄環境,但報錯說Allow不能識別︰
<VirtualHost *:18040>
ServerName xx.xx.xx.xx
DocumentRoot "C:/server/phpMyAdmin"
<Directory "C:/server/phpMyAdmin">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.php index.htm
Allow from all
Require all granted
</Directory>
</VirtualHost>
網上查找一下發現在httpd.conf有一個模組被註解了︰
LoadModule access_compat_module modules/mod_access_compat.so
解除註解就可以了。
Reference: Apache启动 报Invalid command 'order', perhaps misspelled or defined by a module not included
<VirtualHost *:18040>
ServerName xx.xx.xx.xx
DocumentRoot "C:/server/phpMyAdmin"
<Directory "C:/server/phpMyAdmin">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.php index.htm
Allow from all
Require all granted
</Directory>
</VirtualHost>
網上查找一下發現在httpd.conf有一個模組被註解了︰
LoadModule access_compat_module modules/mod_access_compat.so
解除註解就可以了。
Reference: Apache启动 报Invalid command 'order', perhaps misspelled or defined by a module not included
自行配置PHP環境
Apache 2.4
https://www.apachehaus.com/cgi-bin/download.plx#APACHE24VC11
先修改apache/conf/httpd.conf裏面的ServerRoot和DocumentRoot。
用admin打開cmd,到達apache/bin目錄中,執行httpd.exe -k install進行安裝。
然後可以用httpd.exe -k start啓用,httpd.exe -k stop停止。
更多指令可以查看這裏。
PHP 5.6
https://windows.php.net/download#php-5.6
解除ext-mysqli, ext-curl的註解。
MySQL 5.7
https://downloads.mysql.com/archives/installer/
直接看安裝教學。看缺少什麼包,上網找安裝檔。
Composer
https://getcomposer.org/download/
安裝後可以快速配置php模組。
phpMyAdmin
https://docs.phpmyadmin.net/en/latest/setup.html#installing-on-windows
用composer安裝。
在apache配置好vhost,運行路徑。
打開phpMyAdmin目錄,將config.sample.inc.php複製一份重新命名為config.inc.php。可以在裏面改MySQL的host。
https://www.apachehaus.com/cgi-bin/download.plx#APACHE24VC11
先修改apache/conf/httpd.conf裏面的ServerRoot和DocumentRoot。
用admin打開cmd,到達apache/bin目錄中,執行httpd.exe -k install進行安裝。
然後可以用httpd.exe -k start啓用,httpd.exe -k stop停止。
更多指令可以查看這裏。
PHP 5.6
https://windows.php.net/download#php-5.6
解除ext-mysqli, ext-curl的註解。
MySQL 5.7
https://downloads.mysql.com/archives/installer/
直接看安裝教學。看缺少什麼包,上網找安裝檔。
Composer
https://getcomposer.org/download/
安裝後可以快速配置php模組。
phpMyAdmin
https://docs.phpmyadmin.net/en/latest/setup.html#installing-on-windows
用composer安裝。
在apache配置好vhost,運行路徑。
打開phpMyAdmin目錄,將config.sample.inc.php複製一份重新命名為config.inc.php。可以在裏面改MySQL的host。
Thursday, November 8, 2018
Error: The mysqli extension is missing. Please check your PHP configuration. See our documentation for more information.
在安裝phpMyAdmin後,打開browser時出現這個錯誤信息︰
The mysqli extension is missing. Please check your PHP configuration. See our documentation for more information.
網上找了一般時間都是說在C:/php/php.ini 解除php_mysqli.dll的注解。我照著做了也依舊出現這個問題,甚至重啓了也沒有作用。
於是在youtube找到了解決方案︰
The mysqli extension is missing. Please check your PHP configuration. See our documentation for more information.
網上找了一般時間都是說在C:/php/php.ini 解除php_mysqli.dll的注解。我照著做了也依舊出現這個問題,甚至重啓了也沒有作用。
於是在youtube找到了解決方案︰
- 進入到apache的bin目錄。
- 輸入mklink php.ini c:/php/php.ini,建立捷徑。
- 重新載入網頁。
這樣就解決了~
Friday, November 25, 2016
apache2: set default page
在Linux安裝apache後設定預設網頁,需要把︰/etc/apache2/sites-available/000-default.conf
裏面的︰DocumentRoot /var/www/html更改為自己想要的目錄,如 DocumentRoot /var/www/dokuwiki。
這樣設定的話,在進入到連結時就會調用dokuwiki文件內的index.php作為起始文件。
裏面的︰DocumentRoot /var/www/html更改為自己想要的目錄,如 DocumentRoot /var/www/dokuwiki。
這樣設定的話,在進入到連結時就會調用dokuwiki文件內的index.php作為起始文件。
Subscribe to:
Posts (Atom)