win10»·¾³PHP 7 °²×°ÅäÖ᾽̡̳¿

5年以前  |  阅读数:430 次  |  编程语言:PHP 

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.

 相关文章:
PHP分页显示制作详细讲解
SSH 登录失败:Host key verification failed
获取IMSI
将二进制数据转为16进制以便显示
获取IMEI
文件下载
贪吃蛇
双位运算符
PHP自定义函数获取搜索引擎来源关键字的方法
Java生成UUID
发送邮件
年的日历图
提取后缀名
在Zeus Web Server中安装PHP语言支持
让你成为最历害的git提交人
Yii2汉字转拼音类的实例代码
再谈PHP中单双引号的区别详解
指定应用ID以获取对应的应用名称
Python 2与Python 3版本和编码的对比
php封装的page分页类完整实例