详解PHP安装及lnmp完整搭建-wordpress
详解PHP安装及lnmp完整搭建-wordpress
安装所需的lib库 [root@lnmp01 tools]# rpm -qa zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel zlib-devel-1.2.3-29.el6.x86_64 [root@lnmp01 tools]# rpm -qa freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel [root@lnmp01 tools]# yum install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel -y [root@lnmp01 tools]# yum install freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel -y 安装libiconv(无法安装) [root@lnmp01 tools]# rz rz waiting to receive. ???a? zmodem ′???£ °′ Ctrl+C ???£ ??′?? libiconv-1.14.tar.gz... 100% 4867 KB 4867 KB/s 00:00:01 0 ′? ?[root@lnmp01 tools]# tar zxf libiconv-1.14.tar.gz [root@lnmp01 tools]# cd libiconv-1.14 [root@lnmp01 libiconv-1.14]# ./configure --prefix=/usr/local/libiconv [root@lnmp01 libiconv-1.14]# make [root@lnmp01 libiconv-1.14]# make install [root@lnmp01 libiconv-1.14]# cd ../ 安装三方yum源相关库 [root@lnmp01 tools]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo [root@lnmp01 tools]# yum -y install libmcrypt-devel [root@lnmp01 tools]# yum -y install mahash [root@lnmp01 tools]# yum -y install mcrypt 安装php编译php [root@lnmp01 tools]# cd /home/lufeng/tools [root@lnmp01 tools]# rz -y [root@lnmp01 tools]# tar zxf ............ [root@lnmp01 tools]# cd php-5.3.27 [root@lnmp01 tools]# ./configure \ --prefix=/application/php5.3.27 \ --with-mysql=mysqlnd \ --with-iconv-dir=/usr/local/libiconv \ --with-freetype-dir \ --with-jpeg-dir \ --with-png-dir \ --with-zlib \ --with-libxml-dir=/usr \ --enable-xml \ --disable-rpath \ --enable-safe-mode \ --enable-bcmath \ --enable-shmop \ --enable-sysvsem \ --enable-inline-optimization \ --with-curl \ --with-curlwrappers \ --enable-mbregex \ --enable-fpm \ --enable-mbstring \ --with-mcrypt \ --with-gd \ --enable-gd-native-ttf \ --with-openssl \ --with-mhash \ --enable-pcntl \ --enable-sockets \ --with-xmlrpc \ --enable-zip \ --enable-soap \ --enable-short-tags \ --enable-zend-multibyte \ --enable-static \ --with-xsl \ --with-fpm-user=nginx \ --with-fpm-group=nginx \ --enable-ftp +--------------------------------------------------------------------+ | License: | | This software is subject to the PHP License, available in this | | distribution in the file LICENSE. By continuing this installation | | process, you are bound by the terms of this license agreement. | | If you do not agree with the terms of this license, you must abort | | the installation process at this point. | +--------------------------------------------------------------------+ Thank you for using PHP. [root@lnmp01 php-5.3.27]# touch ext/phar/phar.phar [root@lnmp01 php-5.3.27]# make Build complete. Don't forget to run 'make test'. [root@lnmp01 php-5.3.27]# make install /home/lufeng/tools/php-5.3.27/build/shtool install -c ext/phar/phar.phar /application/php5.3.27/bin ln -s -f /application/php5.3.27/bin/phar.phar /application/php5.3.27/bin/phar Installing PDO headers: /application/php5.3.27/include/php/ext/pdo/ 配置php及启动 [root@lnmp01 php-5.3.27]# ln -s /application/php5.3.27 /application/php [root@lnmp01 php-5.3.27]# ls -l /application/php [root@lnmp01 php-5.3.27]# ls php.ini* php.ini-development php.ini-production [root@lnmp01 php-5.3.27]# cp php.ini-production /application/php/lib/php.ini [root@lnmp01 php-5.3.27]# cd /application/php/etc/ [root@lnmp01 etc]# cp php-fpm.conf.default php-fpm.conf [root@lnmp01 etc]# /application/php/sbin/php-fpm [root@lnmp01 etc]# ps -ef|grep php-fpm root 7337 1 0 15:03 ? 00:00:00 php-fpm: master process (/application/php5.3.27/etc/php-fpm.conf) nginx 7338 7337 0 15:03 ? 00:00:00 php-fpm: pool www nginx 7339 7337 0 15:03 ? 00:00:00 php-fpm: pool www root 7341 6079 0 15:03 pts/0 00:00:00 grep php-fpm 配置nginx支持PHP请求访问 [root@lnmp01 blog]# cd /application/nginx/conf/extra/ [root@lnmp01 extra]# cat blog.conf server { listen 80; server_name blog.lufeng.com; location / { root html/blog; index index.html index.html; } location ~ .*\.(php|php5)?$ { root html/blog; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } } [root@lnmp01 conf]# ../sbin/nginx -t nginx: the configuration file /application/nginx-1.6.3/conf/nginx.conf syntax is ok nginx: configuration file /application/nginx-1.6.3/conf/nginx.conf test is successful [root@lnmp01 conf]# ../sbin/nginx -s reload [root@lnmp01 conf]# cd ../html/blog/ [root@lnmp01 blog]# echo "<?php phpinfo(); ?>" >test_info.php [root@lnmp01 blog]# cat test_info.php <?php phpinfo(); ?> 部署blog程序-mysql [root@Mysql-server ~]# mysql -uroot -p Enter password: mysql> create database wordpress; mysql> show databases like 'wordpress'; mysql> grant all on wordpress.* to wordpress@'192.1.1.%' identified by '199429'; mysql> show grants for wordpress@'192.1.1.%'; mysql> select user,host from mysql.user; mysql> quit nginx与PHP环境配置准备 [root@lnmp01 extra]# cd ../../html/blog/ [root@lnmp01 blog]# rz [root@lnmp01 blog]# tar xf wordpress-4.7.2-zh_CN.tar.gz [root@lnmp01 blog]# ls test_info.php wordpress wordpress-4.7.2-zh_CN.tar.gz [root@lnmp01 blog]# rm test_info.php [root@lnmp01 blog]# mv wordpress/* . [root@lnmp01 blog]# /bin/mv wordpress-4.7.2-zh_CN.tar.gz /home/lufeng/tools/ [root@lnmp01 blog]# chown -R nginx.nginx ../blog/ [root@lnmp01 blog]# ls -l
以上是详解PHP安装及lnmp完整搭建-wordpress的详细内容。更多信息请关注PHP中文网其他相关文章!

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

有四种方法可以调整 WordPress 文章列表:使用主题选项、使用插件(如 Post Types Order、WP Post List、Boxy Stuff)、使用代码(在 functions.php 文件中添加设置)或直接修改 WordPress 数据库。

要使用 WordPress 主机建站,需要:选择一个可靠的主机提供商。购买一个域名。设置 WordPress 主机帐户。选择一个主题。添加页面和文章。安装插件。自定义您的网站。发布您的网站。

更换 WordPress 主题头部图片的分步指南:登录 WordPress 仪表盘,导航至“外观”>“主题”。选择要编辑的主题,然后单击“自定义”。打开“主题选项”面板并寻找“网站标头”或“头部图片”选项。单击“选择图像”按钮并上传新的头部图片。裁剪图像并单击“保存并裁剪”。单击“保存并发布”按钮以更新更改。

IIS和PHP可以兼容,通过FastCGI实现。1.IIS通过配置文件将.php文件请求转发给FastCGI模块。2.FastCGI模块启动PHP进程处理请求,提高性能和稳定性。3.实际应用中需注意配置细节、错误调试和性能优化。

导入 WordPress 源码需要以下步骤:创建子主题以进行主题修改。导入源码,覆盖子主题中的文件。激活子主题,使其生效。测试更改,确保一切正常。

可以通过以下方法查看 WordPress 前端:登录仪表盘并切换到“查看站点”选项卡;使用无头浏览器自动化查看过程;安装 WordPress 插件在仪表盘内预览前端;通过本地 URL 查看前端(如果 WordPress 在本地设置)。

多次调用session_start()会导致警告信息和可能的数据覆盖。1)PHP会发出警告,提示session已启动。2)可能导致session数据意外覆盖。3)使用session_status()检查session状态,避免重复调用。

WordPress 编辑日期可以通过三种方法取消:1. 安装 Enable Post Date Disable 插件;2. 在 functions.php 文件中添加代码;3. 手动编辑 wp_posts 表中的 post_modified 列。
