zoukankan      html  css  js  c++  java
  • apache-php

    1、安装apache

    https://www.cnblogs.com/lxlb/p/9159056.html

    2、安装php

    https://www.cnblogs.com/37yan/p/6879404.html

    3、配置apache支持php

    https://www.cnblogs.com/qiuxiao/p/6815350.html

    4、配置apache

    <VirtualHost *:80>
    ServerName ***.com
    DocumentRoot "/data1/php/***"
    <Directory "/data1/php/***">
            SetOutputFilter DEFLATE
            Options FollowSymLinks
            AllowOverride ALL
            Order allow,deny
            Allow from all
    </Directory>
    </VirtualHost>

    5、如果有thinkphp,需要在根目录配置.htaccess

    <IfModule mod_rewrite.c>
      options +FollowSymlinks
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
    </IfModule>

    然后

     Apache的配置文件mod_rewrite.so开启

    AllowOverride None改为AllowOverride All 

    重启apache后即可

    如果用NGINX的话,需要开启fastcgi,配置如下:

    server{
            listen 80;
            server_name edu.mazazikaou.com;
            root /data1/www/edu;
            index index.php index.html index.htm;
    
            location / {
                if ( !-e $request_filename){
                    rewrite ^/(.*)$ /index.php/$1 last;
                    break;
                    }
            }
    
            location ~ .php(/|$) {
                fastcgi_pass    127.0.01:9000;
                fastcgi_index   index.php;
                include         fastcgi.conf;
                set $fastcgi_script_name2 $fastcgi_script_name;
                if ($fastcgi_script_name ~ "^(.+.php)(/.+)$") {
                    set $fastcgi_script_name2 $1;
                    set $path_info $2;
                    }
                fastcgi_param    PATH_INFO $path_info;
                fastcgi_param    SCRIPT_FILENAME   $document_root$fastcgi_script_name2;
                fastcgi_param    SCRIPT_NAME    $fastcgi_script_name2;
            }
    }

  • 相关阅读:
    D2. Remove the Substring (hard version)(思维 )
    暑假集训
    AcWing:167. 木棒(dfs + 剪枝)
    AcWing:109. 天才ACM(倍增 + 归并排序)
    AcWing:99. 激光炸弹(前缀和)
    B. Interesting Array(线段树)
    Best Reward HDU
    G. Swapping Places
    How many HDU
    GSS4&&花仔游历各国
  • 原文地址:https://www.cnblogs.com/zphqq/p/9671024.html
Copyright © 2011-2022 走看看