PHP 7³oÀ´ºÃÒ»¶Îʱ¼aÁË£¬Ç°Ð(C)ÈÕ×Ó¹¤×÷±È½Ï棬ûʱ¼aÑо¿£¬ÏÖÔÚÓеaʱ¼aÁË£¬¹«Ë¾ÀiÉu²u»*¾³²»ÄÜËae±aÉý¼¶£¬¼ÒÀi×Ô¼ºµÄµçÄÔ»¹ÊÇ¿ÉÒÔװһϿ´¿´Ð§¹uµÄ¡£
ÏÂÃae¼oµ¥ËµÃ÷Ò»ÏÂPHP 7 + Apache 2.4µÄ°²×°¡£
Apache 2.4 °²×°ÅaÖÃ °²×°
Apache 2.4£¬ÔÚ¹Ù*½ÍøÕ¾ÉÏûÓÐWindowsϵıaÒe°ae±¾£¬ÐeÒªµ½http://httpd.apache.org/docs/2.4/platform/windows.htmlÕÒµ½Ìa¹(C)Windows±aÒe°ae±¾ÏÂÔصľµÏñÍøÕ¾£¬ÎÒÓõÄÊÇ£ºhttp://www.apachelounge.com/download/£¬¸u¾ÝÐeÒªÏÂÔØ32»o64λ°ae±¾£¬ÏÂÔغoÊǸozip°u¡£ÏÂÔغo£¬½«ZIP°uÄÚµÄApace24Ŀ¼½aѹµ½ÈÎÒaĿ¼¡£
×¢Òa£ºApacheºÍPHPµÄÒ»Ð(C)ÐÅϢҪƥÅa£¬°uÀ¨32/64λ¡¢VC°ae±¾ºÅ¡£¶ÔÓÚPHP 7£¬¹ÙÍøÉÏÖ»ÓÐVC14±aÒeµÄ°ae±¾£¬Òo´Ë¶ÔÓ¦µÄApache°ae±¾Ò²ÐeÒªÊÇVC14±aÒeµÄ¡£
ÅaÖÃ
µ¥Õ¾µaÅaÖÃ
´o¿ª%Apache24%\conf\httpd.confÎļþ£º
1¡¢ ÕÒµ½¡°ServerRoot¡±£¬½«ÆaÖ¸¶¨Îª%Apache24%ËuÔÚĿ¼£»
2¡¢ ÐÞ¸ÄÎĵµ¸uĿ¼£»
DocumentRoot "E:/wwwpages"
<Directory "E:/wwwpages">
3¡¢ Ìi¼Ó index.php µ½ index Ŀ¼ÖÐ
DirectoryIndex index.html index.php
4¡¢ °ÑApache°²×°³É*þÎñ£º
httpd.exe -k install -n "Apache24"
Èo*þÎñÆo¶¯Ê§°ÜÔoÐÞ¸Ä϶˿ںš£
¶aÕ¾µaÅaÖã¨Óö˿ںÅÇø*Ö£(C)
ÔÚһ̨þÎñÆ÷ÉÏ¿ÉÒÔÅaÖöa¸oÕ¾µa£¬±¾½Ú˵Ã÷ÈçºÎÅaÖÃͨ¹ý¶Ë¿ÚºÅÇøֵIJ»Í¬Õ¾µa¡£
ÅaÖÃhttpd.conf¡£
Ê×ÏÈÔo¼Ó¼aÌý¶Ë¿Ú£¨ÅaÖü¸¸oÕ¾µa£¬¾ÍÔo¼Ó¼¸¸o¶Ë¿Ú£(C)£º
Listen 8081
Listen 8082
µÈÒÔÉÏÄÚÈݶ¼ÉeÖÃÒÔºo£¬¿ÉÒÔͨ¹ýnetstat -n -a²e¿´¶Ë¿ÚÊÇ*ñ¿ªÆo¡£
Æa´ÎÅaÖÃÐeÄaÕ¾µa£º
NameVirtualHost *:8080
<VirtualHost *:8080>
ServerName www.mysite1.com
#DocumentRoot "C:/Rainman/ProjectWorkspace2.0/SourceCode/Server/wanpush"
DocumentRoot "C:/Rainman/ProjectWorkspace3.0_clound/SourceCode"
<Directory "C:/Rainman/ProjectWorkspace3.0_clound/SourceCode">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ErrorLog "logs/mysite1.com-error.log"
CustomLog "logs/mysite1.com-access.log" common
</VirtualHost>
NameVirtualHost *:8081
<VirtualHost *:8081>
ServerName www.mysite2.com
DocumentRoot "C:/Rainman/ProjectWorkspace3.0_clound/yiqixiu"
<Directory "C:/Rainman/ProjectWorkspace3.0_clound/yiqixiu">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ErrorLog "logs/mysite2.com-error.log"
CustomLog "logs/mysite2.com-access.log" common
</VirtualHost>
Ö÷ҪΪÿ¸oÐeÄaÕ¾µaÅaÖÃDocumentRootºÍDirectory²ÎÊý¡£
ÑeÖ¤
°²×°Íe³Éºo£¬±aдÈçÏÂHTMLÒ³Ãae£º
<html>
<body>
<h1>Hello world!</h1>
</body>
</html>
Ái´aeΪindex.html£¬¸ÃÎļþ¿½±´µ½¡°E:/wwwpages¡±Ï¡£
´o¿ªURL£ºhttp://localhost:8080/£¬Ò³ÃaeÏÔʾ¡°Hello world!¡±£¬Ôo±iʾApache°²×°Æo¶¯³É¹¦¡£
*жÔØþÎñ **
жÔØ*þÎñ£ºhttpd ¨Ck uninstall ¨Cn ¡°apache24¡±
×¢Òa£ºÃu³ÆÒ»¶¨Òª¸u°²×°Ê±µÄÃu³Æ±£³ÖÒ»Ö¡£
PHP 7.0.6 °²×°ÅaÖà °²×° ÏÂÔØphp-7.0.6-Win32-VC14-x64.zip£¬½«Æa½aѹµ½ÈÎÒaĿ¼¡£
ÅaÖà 1¡¢ÅaÖÃApache
´o¿ªApacheµÄÅaÖÃÎļþ£¬Ôo¼ÓÈçÏÂÄÚÈÝ£º
LoadModule php7_module "D:/PHPDevEnv/PHP/php7apache2_4.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html
AddHandler application/x-httpd-php .php
PHPIniDir "D:/PHPDevEnv/PHP"
×¢£ººiÉ«²¿ÖʹÓÃʵ¼ÊµÄ¾¶¡£
2¡¢ÅaÖÃPHP
½«PHPĿ¼ÏµÄphp.ini-development¸ÄÃuΪphp.ini£¬È»ºo´o¿ª¸ÃÎļþ£¬²eÕÒ¡°extension_dir¡±£¬½«Ç°Ãae×¢ÊÍÈ¥µo£¬²¢ÐÞ¸ÄΪ¾ø¶ÔÂ*¾¶£¬Æ(C)È磺
extension_dir = "D:/PHPDevEnv/PHP/ext"
×¢£ºÐÞ¸ÄΪ¾ø¶Ô¾¶£¬ÊDZÜÃaÓÐÐ(C)PHPÀ(C)Õ¹ÕÒ²»µ½ÕýȵÄÂ*¾¶¡£
ÑeÖ¤ ÔÚApacheÍøÕ¾¸uĿ¼£¨¾ßÌaλÖüu2.1½Ú£(C)Ï´´½¨Ò»¸o phpinfo.php Îļþ£º
<?php
phpinfo();
?>
ÔÚa¯ÀÀÆ÷Öдo¿ªhttp://localhost:8080/phpinfo.php.