Home > php教程 > php手册 > freebsd+nginx+mysql+php

freebsd+nginx+mysql+php

WBOY
Release: 2016-06-06 19:51:07
Original
943 people have browsed it

在haproxy中添加backend, 规则是host名称iefreer.domain.com; cd usr/ports make search key=^nginx .... 如上用ports安装完所有的软件: nginx,mysql,php-fpm(安装php5.3.x或者php5.4.x时,选中php-fpm选项),phpmyadmin faq1. 访问页面出现空白页,或者找不到

在haproxy中添加backend, 规则是host名称iefreer.domain.com;


cd usr/ports

make search key=^nginx

....

如上用ports安装完所有的软件: nginx,mysql,php-fpm(安装php5.3.x或者php5.4.x时,选中php-fpm选项),phpmyadmin


faq1. 访问页面出现空白页,或者找不到文件,或者输入文件未指定, 如果确认fastcgi9000端口正常监听,且有access日志,但php文件根本未执行,

这多半是因为配置文件的错误引起. 尤其是其中的SCRIPT_NAME参数设置

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

需要检查$document_root参数是否定义正确,是否被定义了. 比如如果你是在某个location条件分支里定义了root, 这个root在其他location中是不起作用的.


faq2. phpmyadmin的配置使用alias

    #phpmyadmin
    location /phpmyadmin {
        alias /usr/local/www/phpMyAdmin;
        index index.php;
    }

    location ~ /phpmyadmin/.+\.php$ {
        if ($fastcgi_script_name ~ /phpmyadmin/(.+\.php.*)$) {
            set $valid_fastcgi_script_name $1;
        }
        include fastcgi_params;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param SCRIPT_FILENAME /usr/local/www/phpMyAdmin/$valid_fastcgi_script_name;
    }

并确保目录权限,所有人正确


faq3. 访问phpmyadmin返回mysqli扩展未安装

原因是装phpmyadmin时起用了mysqli,但该扩展未安装

cd /usr/ports

make search key=mysqli

安装mysqli扩展

然后重新启动相关服务(nginx, mysql_server)


iefreer




Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template