在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
nginx命令 /etc/init.d/php-fpm restart 最后只要 yum -y update 一下,全是最新的 你可以用下列方法检查配置文件是否有语法错误
问题: 1.打开phpmyadmin时出现mysqli扩展 设置:extension_ext = "/var/lib64/php/modules"; 2.打开phpmyadmin时,出现:Error during session start; please check your PHP and/or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser. 首先看session.auto_start = 0,如果设置0不行,就设置1. 1.MySQL 配置yum源:http://dev.mysql.com/doc/mysql-repo-excerpt/5.6/en/linux-installation-yum-repo.html # yum -y install mysql-server 2.Nginx. 在/etc/yum.repos.d/目录下建立一个nginx.repo软件源配置文件。命令如下: 然后填写如下文件内容 [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=0 enabled=1 注意:一定要看这句话(参考:http://nginx.org/en/linux_packages.html#stable) 执行vim命令保存文件为nginx.repo完整路径是/etc/yum.repos.d/nginx.repo 执行yum命令安装nginx yum install nginx 添加防火墙 -A INPUT –m state –state NEW –m tcp –p tcp –dport 80 –j ACCEPT
在修改完防火墙后需要执行如下命令重启防火
nginx伪静态: 1.将include /www/web1.nginx加入到nginx的虚拟机配置文件中, 2.伪静态文件: rewrite ^/about\.html$ /?do=profile last; 注意:1.前部分需要加根目录斜线"/";
编译安装:(参考:http://lxsym.blog.51cto.com/1364623/293096) 安装PHP(PHP5.3以后,php-fpm就是php的核心模块存在了)
整合Nginx与PHP 看上图,Nginx已经知道怎么把得到的请求传达给PHP,Nginx在得到*.php请求时,会把请求通过9000端口传给PHP。 那么只有Nginx自己知道咋找PHP了还不行,还需要PHP知道咋找Nginx,PS:你见过大街上的JJMM约会时有不是相互认识对方,或者是不知道用啥方法和对方接头的?这点我们不需要担心,PHP-FPM已经在配置文件中定义了从哪接受PHP请求,我们可以打开配置文件看一下
php源码安装: 2. ./configure --prefix=/usr/local/php --enable-fpm --enable-mbstring --with-mysql=/usr/local/mysql --with-iconv-dir=/usr/local --with-apxs2=/usr/local/apache2/bin/apxs
PHP编译安装出现的各种问题: php版本:php-5.4.3 安装前.先安装些软件和库文件 yum install -y gcc gcc-c++ make zlib zlib-devel pcre pcre-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers 领导要我们自己手动装 不允许我们直接用yum 所以上面的都没执行 编译安装PHP 进入php的解压目录 ./configure --prefix=/usr/local/php --enable-fpm --with-mcrypt=/usr/local/libmcrypt --with-zlib --enable-mbstring --with-openssl --with-mysql --with-mysqli --with-mysql-sock --with-gd --with-jpeg-dir=/usr/lib --enable-gd-native-ttf --enable-pdo --with-pdo-mysql --with-gettext --with-curl --with-pdo-mysql --enable-sockets --enable-bcmath --enable-xml --with-bz2 --enable-zip --enable-freetype 运行之后遇到的问题: error 1 checking for xml2-config path... (看提示就明白 是一个lib库没装 先用 yum search 名字 看是否能搜到名字 ,找到名字后 把软件包 开发包装上) 解决办法 yum install libxml2-devel.x86_64 error 2 checking for pkg-config... /usr/bin/pkg-config 这是ssl没装 解决办法 yum install openssl.x86_64 openssl-devel.x86_64 -y error 3 checking for BZip2 in default path... not found 这是bzip2软件包没有安装 解决办法 yum install bzip2-devel.x86_64 -y error 4 configure: error: Please reinstall the libcurl distribution - curl和curl库文件没有安装 解决办法 yum install libcurl.x86_64 libcurl-devel.x86_64 -y error 5 checking whether to enable JIS-mapped Japanese font support in GD... no GD库没有安装 解决办法 yum install libjpeg.x86_64 libpng.x86_64 freetype.x86_64 libjpeg-devel.x86_64 libpng-devel.x86_64 freetype-devel.x86_64 -y error 6 checking for stdarg.h... (cached) yes libmcrypt库没有安装 ,要是不能用yun安装的话 就要去下载个gz包 自己编译安装 (编译安装 ./configure --piefix=/usr/local/libmcrypt make && make install) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 要是错误里面含有mysql的 那是mysql-devel 没有安装 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 出现 Generating files configure: creating ./config.status creating main/internal_functions.c creating main/internal_functions_cli.c 编译PHP的--with-gd=/usr/include |
2022-08-30
2022-08-17
2022-11-06
2022-07-18
2022-08-18
请发表评论