美文网首页
wamp配置端口号以及安装PHP扩展

wamp配置端口号以及安装PHP扩展

作者: guyunlige | 来源:发表于2020-07-16 15:10 被阅读0次

    [toc]

    0,版本:wamp3.1.4

    一,wamp Apache 端口号 8080 => 8088

    1,打开配置文件 wamp64\bin\apache\apache2.4.35\conf\httpd.conf
    #
    # Listen: Allows you to bind Apache to specific IP addresses and/or
    # ports, instead of the default. See also the <VirtualHost>
    # directive.
    #
    # Change this to Listen on specific IP addresses as shown below to
    # prevent Apache from glomming onto all bound IP addresses.
    #
    #Listen 12.34.56.78:80
    Listen 0.0.0.0:8088
    Listen [::0]:8088
    
    。。。。。。
    
    #
    # ServerName gives the name and port that the server uses to identify itself.
    # This can often be determined automatically, but we recommend you specify
    # it explicitly to prevent problems during startup.
    #
    # If your host doesn't have a registered DNS name, enter its IP address here.
    #
    ServerName localhost:8088
    

    二,配置多站点

    1, 位置 wamp64\bin\apache\apache2.4.35\conf\extra \ httpd-vhosts.conf
    // 以laravel项目为例,新增下面的代码<VirtualHost *:80>  改为  <VirtualHost *:8088>
    
    # Virtual Hosts
    #
    <VirtualHost *:8088>
      ServerName localhost
      ServerAlias localhost
      DocumentRoot "${INSTALL_DIR}/www"
      <Directory "${INSTALL_DIR}/www/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
      </Directory>
    </VirtualHost>
    #######################################################
    <VirtualHost *:8088>
       ServerName  www.weibo.cc
       DocumentRoot F:/wamp64/www/weibo/public
           <Directory  "F:/wamp64/www/weibo/public">
                Options +Indexes +Includes +FollowSymLinks +MultiViews
                AllowOverride All
                Require local
          </Directory>
    </VirtualHost>
    
    2, windows10配置站点 C:\Windows\System32\drivers\etc\ hosts
    # Copyright (c) 1993-2009 Microsoft Corp.
    #
    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
    #
    # This file contains the mappings of IP addresses to host names. Each
    # entry should be kept on an individual line. The IP address should
    # be placed in the first column followed by the corresponding host name.
    # The IP address and the host name should be separated by at least one
    # space.
    #
    # Additionally, comments (such as these) may be inserted on individual
    # lines or following the machine name denoted by a '#' symbol.
    #
    # For example:
    #
    #      102.54.94.97     rhino.acme.com          # source server
    #       38.25.63.10     x.acme.com              # x client host
    
    # localhost name resolution is handled within DNS itself.
    #   127.0.0.1       localhost
    #   ::1             localhost
    127.0.0.1   localhost
    
    127.0.0.1  www.web.net
    
    刷新DNS

    1,mac: sudo killall -HUP mDNSResponder

    2, windwos: 参考:https://jingyan.baidu.com/article/6d704a13fb6e1828db51ca3a.html

    ctrl + windows 键 ==> cmd  ==>  ipconfig/flushdns
    

    三,配置mysql端口号

    1, 修改 wamp64\bin\mysql\mysql5.7.23\my.ini 默认端口3306 ==> 8806
               注意:不要改成 3307  (wamp中集成 MariaDB【mysql替代品】是3307 )
    
    2,修改 wamp64\bin\php 下有多少个PHP版本就修改多少个

    理科: wamp64\bin\php\php7.2.10\php.ini

    ; Default port number for mysqli_connect().  If unset, mysqli_connect() will use
    ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
    ; compile-time value defined MYSQL_PORT (in that order).  Win32 will only look
    ; at MYSQL_PORT.
    ; http://php.net/mysqli.default-port
    mysqli.default_port = 8806
    

    四,php扩展

    WAMP php7.2 php.ini extension=php_mongo
    
    
    #  http://pecl.php.net/
    
    # .dll 文件储存到 D:\wamp64\bin\php\php7.2.10\ext
    
    # php.ini
    
    extension=php_redis
    extension=php_mongodb
    extension=php_yar
    extension=php_yaf
    
    # wampserver 环境下如何安装mongo扩展 解决一个坑
    
    # 很多教程都是这样的,我很多时候习惯性的从wampserver软件那里打开php.ini
    添加extension=php_mongo.dll
    
    #这样操作或许对于单版本的php集成环境或许没有影响,
    但是我们的wampserver是多php版本的,所有就需要自己
    ****************************************************************************
    再次去当前使用版本的  php.ini 添加extension=php_mongo.dll
    例如我的路径  D:\wamp\bin\php\php7.1.9\php.ini   就可以成功了
    ****************************************************************************
    总结:
    1,  习惯性的从wampserver软件那里打开php.ini
    2,  再修改对应版本的  D:\wamp\bin\php\php7.1.9\php.ini就可以成功了
    

    相关文章

      网友评论

          本文标题:wamp配置端口号以及安装PHP扩展

          本文链接:https://www.haomeiwen.com/subject/gahphktx.html