小编spa*_*oid的帖子

从 php53u 到 php54 的优雅升级

我们正在使用 iuscommunity repo 运行 CentOS 6 节点,并且想要将之前安装的 php53u 升级到 php54。

但是,这会在 php53u 和 php54 之间引入依赖冲突。有没有人对这个问题有想法?

--> Running transaction check
---> Package php54-fpm.i686 0:5.4.5-1.ius.el6 will be installed
--> Processing Dependency: php-common = 5.4.5-1.ius.el6 for package: php54-fpm-5.4.5-1.ius.el6.i686
---> Package php54-gd.i686 0:5.4.5-1.ius.el6 will be installed
---> Package php54-mbstring.i686 0:5.4.5-1.ius.el6 will be installed
---> Package php54-pecl-apc.i686 0:3.1.11-2.ius.el6 will be installed
--> Processing Dependency: php54 >= 5.3.5-1 for package: php54-pecl-apc-3.1.11-2.ius.el6.i686
--> Running transaction check
---> Package php54.i686 0:5.4.5-1.ius.el6 will be installed
--> Processing Dependency: php54-cli …
Run Code Online (Sandbox Code Playgroud)

php centos php-fpm alternative-php-cache

5
推荐指数
1
解决办法
3459
查看次数

在nginx上重写一个子目录到root

假设我有一个站点http://domain/,我将一些文件放在一个子目录中/html_root/app/,我使用以下重写规则将此文件夹重写到我的根目录:

location / {
    root /html_root;
    index index.php index.html index.htm;

    # Map http://domain/x to /app/x unless there is a x in the web root.
    if (!-f $request_filename){
        set $to_root 1$to_root;
    }
    if (!-d $request_filename){
        set $to_root 2$to_root;
    }
    if ($uri !~ "app/"){
        set $to_root 3$to_root;
    }
    if ($to_root = "321"){
        rewrite ^/(.+)$ /app/$1;
    }

    # Map http://domain/ to /app/.
    rewrite ^/$ /app/ last;
}
Run Code Online (Sandbox Code Playgroud)

我知道这不是一个聪明的方法,因为我有另一个子目录/html_root/blog/并且我希望它可以通过http://domain/blog/.

我的问题是,上面的重写规则可以正常工作,但仍然存在一些问题:如果我访问

http://domain/a-simple-page/(改写自http://domain/app/a-simple-page/

它工作正常,但如果我访问

http://domain/a-simple-page …

rewrite nginx

4
推荐指数
1
解决办法
9258
查看次数

标签 统计

alternative-php-cache ×1

centos ×1

nginx ×1

php ×1

php-fpm ×1

rewrite ×1