相信都會時常考慮這樣一個問題,那就是在本地Apache伺服器如何添加php7模組?今天小編就來介紹一下,有需要的可以參考參考。
Apache的一些基礎指令
Options: -D name : define a name for use in <IfDefine name> directives -d directory : specify an alternate initial ServerRoot -f file : specify an alternate ServerConfigFile -C "directive" : process directive before reading config files -c "directive" : process directive after reading config files -n name : set service name and use its ServerConfigFile and ServerRoot -k start : tell Apache to start -k restart : tell running Apache to do a graceful restart -k stop|shutdown : tell running Apache to shutdown -k install : install an Apache service -k config : change startup Options of an Apache service -k uninstall : uninstall an Apache service -w : hold open the console window on error -e level : show startup errors of level (see LogLevel) -E file : log startup errors to file -v : show version number -V : show compile settings -h : list available command line options (this page) -l : list compiled in modules -L : list available configuration directives -t -D DUMP_VHOSTS : show parsed vhost settings -t -D DUMP_RUN_CFG : show parsed run settings -S : a synonym for -t -D DUMP_VHOSTS -D DUMP_RUN_CFG -t -D DUMP_MODULES : show all loaded modules -M : a synonym for -t -D DUMP_MODULES -t -D DUMP_INCLUDES: show all included configuration files -t : run syntax check for config files -T : start without DocumentRoot(s) check -X : debug mode (only one worker, do not detach) ``` 在php官网下载php文件包VC15 x64 Thread Safe (2018-Mar-01 06:45:07)一定要是带有thread的 之后再Apache的httpd.conf中加入
LoadModule php7_module C:/Apache24/php-7.2.3-src/php7apache2_4.dll
#AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
PHPIniDir D:/Apache24/php-7.2.3-src
##`
執行httpd -k start就可以啟動伺服器了,在Apache的htdoc目錄下寫個index.php檔
<?php phpinfo();
在localhost下就能看到效果了
之後修改php.ini檔案
extension_dir = "C:/Apache24/php-7.2.3-src/ext" default_charset = "UTF-8" extension = php_mysql.dll
修改完這3個搭建任務就完成了
推薦學習:php影片教學
以上是本機Apache伺服器如何新增php7模組的詳細內容。更多資訊請關注PHP中文網其他相關文章!