3-OpenResty configuration PHP

https://www.cnblogs.com/yangfengwu/p/11610728.html

 

Because it used to be something to do with PHP, but also do not want to re-use OpenResty own writing, so we set it down, so you can access files as before Apache PHP

Remember how we was installed PHP does not  https://www.cnblogs.com/yangfengwu/p/11037653.html  

Modify php.ini

 

 

 

Modify the inside of openresty nginx.conf

 

Note: If you visit the same path, set out alone

 

 

 

 

 

9000 will be a port that we will use, they can provision Ha

 

 

 

 

    server {# virtual host 
        the listen        80 ; # listening port 
        server_name localhost; # monitor domain 

        #charset KOI8 - r; 

        #access_log logs / host.access.log main; 

    root     " C: \ openresty-1.15.8.2-win64 \ HTML " ; access #PHP html file access paths and path settings, like separate out the path 

        LOCATION / {# is HTTP: // IP / No matter what name will come 
            #root html; 
            index index.html index.htm index.php; # without the foregoing, it automatically accesses the index.php 
        } 

        #error_page   404               / 404 .html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            #root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0. 0.1 : 9000 
        # 172.26 . 94.113    127.0 . 0.1 
        LOCATION ~ \ ~ # {$ .php case sensitive \ $ .php any Representative followed behind the front end of HTTP: // the IP / any / any .php 
            #root HTML; 
            fastcgi_pass    127.0 . 0.1 : 9000 ; 
            fastcgi_index the index.php; 
            fastcgi_param SCRIPT_FILENAME $ $ DOCUMENT_ROOT fastcgi_script_name; 
            the include fastcgi_params; 
        } 

        # .htaccess the deny Access to Files, IF the Apache ' S Document the root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }

 

Configuration finished OpenResty

If you start too Nginx need to close

 

 

 

 

 

 

 

 Then restart

 

 

 

Inside there was explanation launched

 

 

 

 

 

 

 

Then enter the command prompt

C:\php7/php-cgi.exe -b 127.0.0.1:9000 -c C:\php7/php.ini 

 

 According to their installation path Ha, my installation path is

 

 

 

 

 9000 is the top port

Run command

 

 

 

 

 

 

 

Under the test, put the root directory of the file is now a ceshi.php

 

 

 Written on the inside

 

 

<?php
    echo 1234;
?>

 

http://47.92.31.46/ceshi.php

 

All his own previous file copied to this directory can

 

https://www.cnblogs.com/yangfengwu/p/11610764.html

 

Guess you like

Origin www.cnblogs.com/yangfengwu/p/11610760.html