httpd 集成 php 模块

  

 

  1. 下载php



    httpd 集成 php 模块

     

     httpd 集成 php 模块

     

     

     

     

  2. 配置httpd

    LoadModule php7_module D:/wamp/php/php7apache2_4.dll 
    Include conf/extra/httpd-fcgid.conf
    PHPIniDir "D:/wamp/php/"
    
    <IfModule dir_module>
        DirectoryIndex index.php index.html default.html index.hml
    </IfModule>
    
    <IfModule mime_module>
        AddType application/x-httpd-php .php
    </IfModule>
    
    <FilesMatch "\.php$">
        SetHandler application/x-httpd-php
    </FilesMatch>
    
    <FilesMatch "\.phps$">
        SetHandler application/x-httpd-php-source
    </FilesMatch>

      



  3. php.ini

    extension_dir = "D:/wamp/php/ext"
    extension=php_mbstring.dll
    extension=php_mysqli.dll
    extension=php_pdo_mysql.dll 
    short_open_tag = On
    date.timezone=PRC

     

  4. 测试
    <?php
    // phpinfo();
    $link=mysqli_connect('localhost:3306','root','cruces') or die('error');
    var_dump($link);
    ?>1

     

    <?php
        $link=mysqli_connect('localhost','root','cruces','abate');
        $sql='select * from `student`';
        $result=mysqli_query($link,$sql);
        $data=mysqli_fetch_all($result,MYSQLI_ASSOC);
        // var_dump($data);
        echo json_encode($data);
        
    ?>

     

    <?php
        $arr=['aa'=>'aaa','bb'=>'bbb'];
        // print_r($arr);
        $jsonStr=json_encode($arr);
        echo '<br/>';
        echo $jsonStr;
        $string=json_decode($jsonStr);
        echo '<br/>';
        print_r($string);
    ?>



上一篇:CREATE EXTENSION postgis_topology


下一篇:终于解决ERROR: PHP's 'ldap' extension is not installed/enabled. Please check your MR