discuz x2不能识别mysql,mysql也不能centos 重装mysql,加qq666206解决,悬赏一百分解决完追加五十。

本人有linux系统,想搭建一个discuz X2新版本的论坛~ apache,php,mysql都弄好了~ 请问怎么安装!~_百度知道
本人有linux系统,想搭建一个discuz X2新版本的论坛~ apache,php,mysql都弄好了~ 请问怎么安装!~
我下了那2个包在官网论坛上可是用UZIP命令解压错误··
我有更好的答案
把discuz传到www的指定位置
设置好目录权限 按照install.php步骤链接数据库 一步一步做就ok
指定WEB站点的根目录,把DZ放到根目录,在地址栏输入你站点的域名或IP地址,接着就是NEXT、NEXT
这些都有了上传程序搭建就好了
为您推荐:
其他类似问题
您可能关注的内容
linux系统的相关知识
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。博客分类:
本文章已收录于:
对于开发来说需要有好的生态开发库来辅助我们快速开发,而Lua中也有大多数我们需要的第三方开发库如Redis、Memcached、Mysql、Http客户端、JSON、模板引擎等。
一些常见的Lua库可以在github上搜索,。
Redis客户端
lua-resty-redis是为基于cosocket API的ngx_lua提供的Lua redis客户端,通过它可以完成Redis的操作。默认安装OpenResty时已经自带了该模块,使用文档可参考。
在测试之前请启动Redis实例:
nohup /usr/servers/redis-2.8.19/src/redis-server
/usr/servers/redis-2.8.19/redis_6660.conf &
1、基本操作
编辑test_redis_baisc.lua
local function close_redis(red)
if not red then
local ok, err = red:close()
if not ok then
ngx.say("close redis error : ", err)
local redis = require("resty.redis")
--创建实例
local red = redis:new()
--设置超时(毫秒)
red:set_timeout(1000)
--建立连接
local ip = "127.0.0.1"
local port = 6660
local ok, err = red:connect(ip, port)
if not ok then
ngx.say("connect to redis error : ", err)
return close_redis(red)
--调用API进行处理
ok, err = red:set("msg", "hello world")
if not ok then
ngx.say("set msg error : ", err)
return close_redis(red)
--调用API获取数据
local resp, err = red:get("msg")
if not resp then
ngx.say("get msg error : ", err)
return close_redis(red)
--得到的数据为空处理
if resp == ngx.null then
--比如默认值
ngx.say("msg : ", resp)
close_redis(red)
基本逻辑很简单,要注意此处判断是否为nil,需要跟ngx.null比较。
2、example.conf配置文件
location /lua_redis_basic {
default_type 'text/html';
content_by_lua_file /usr/example/lua/test_redis_basic.
3、访问如http://192.168.1.2/lua_redis_basic进行测试,正常情况得到如下信息
msg : hello world
建立TCP连接需要三次握手而释放TCP连接需要四次握手,而这些往返时延仅需要一次,以后应该复用TCP连接,此时就可以考虑使用连接池,即连接池可以复用连接。
我们只需要将之前的close_redis函数改造为如下即可:
local function close_redis(red)
if not red then
--释放连接(连接池实现)
local pool_max_idle_time = 10000 --毫秒
local pool_size = 100 --连接池大小
local ok, err = red:set_keepalive(pool_max_idle_time, pool_size)
if not ok then
ngx.say("set keepalive error : ", err)
即设置空闲连接超时时间防止连接一直占用不释放;设置连接池大小来复用连接。
此处假设调用red:set_keepalive(),连接池大小通过nginx.conf中http部分的如下指令定义:
#默认连接池大小,默认30
lua_socket_pool_size 30;
#默认超时时间,默认60s
lua_socket_keepalive_timeout 60s;
1、连接池是每Worker进程的,而不是每Server的;
2、当连接超过最大连接池大小时,会按照LRU算法回收空闲连接为新连接使用;
3、连接池中的空闲连接出现异常时会自动被移除;
4、连接池是通过ip和port标识的,即相同的ip和port会使用同一个连接池(即使是不同类型的客户端如Redis、Memcached);
5、连接池第一次set_keepalive时连接池大小就确定下了,不会再变更;
5、cosocket的连接池。
3、pipeline
pipeline即管道,可以理解为把多个命令打包然后一起发送;MTU(Maxitum Transmission Unit 最大传输单元)为二层包大小,一般为1500字节;而MSS(Maximum Segment Size 最大报文分段大小)为四层包大小,其一般是1500-20(IP报头)-20(TCP报头)=1460字节;因此假设我们执行的多个Redis命令能在一个报文中传输的话,可以减少网络往返来提高速度。因此可以根据实际情况来选择走pipeline模式将多个命令打包到一个报文发送然后接受响应,而Redis协议也能很简单的识别和解决粘包。
1、修改之前的代码片段
red:init_pipeline()
red:set("msg1", "hello1")
red:set("msg2", "hello2")
red:get("msg1")
red:get("msg2")
local respTable, err = red:commit_pipeline()
--得到的数据为空处理
if respTable == ngx.null then
respTable = {}
--比如默认值
--结果是按照执行顺序返回的一个table
for i, v in ipairs(respTable) do
ngx.say("msg : ", v, "&br/&")
通过init_pipeline()初始化,然后通过commit_pipieline()打包提交init_pipeline()之后的Redis命令;返回结果是一个lua table,可以通过ipairs循环获取结果;
2、配置相应location,测试得到的结果
msg : OKmsg : OKmsg : hello1msg : hello2
3、Redis Lua脚本
利用Redis单线程特性,可以通过在Redis中执行Lua脚本实现一些原子操作。如之前的red:get("msg")可以通过如下两种方式实现:
1、直接eval:
local resp, err = red:eval("return redis.call('get', KEYS[1])", 1, "msg");
2、script load然后evalsha
SHA1 校验和,这样可以节省脚本本身的服务器带宽:
local sha1, err = red:script("load",
"return redis.call('get', KEYS[1])");
if not sha1 then
ngx.say("load script error : ", err)
return close_redis(red)
ngx.say("sha1 : ", sha1, "&br/&")
local resp, err = red:evalsha(sha1, 1, "msg");
首先通过script load导入脚本并得到一个sha1校验和(仅需第一次导入即可),然后通过evalsha执行sha1校验和即可,这样如果脚本很长通过这种方式可以减少带宽的消耗。
此处仅介绍了最简单的redis lua脚本,更复杂的请参考官方文档学习使用。
另外Redis集群分片算法该客户端没有提供需要自己实现,当然可以考虑直接使用类似于Twemproxy这种中间件实现。
Memcached客户端使用方式和本文类似,本文就不介绍了。
Mysql客户端
lua-resty-mysql是为基于cosocket API的ngx_lua提供的Lua Mysql客户端,通过它可以完成Mysql的操作。默认安装OpenResty时已经自带了该模块,使用文档可参考。
1、编辑test_mysql.lua
local function close_db(db)
if not db then
db:close()
local mysql = require("resty.mysql")
--创建实例
local db, err = mysql:new()
if not db then
ngx.say("new mysql error : ", err)
--设置超时时间(毫秒)
db:set_timeout(1000)
local props = {
host = "127.0.0.1",
port = 3306,
database = "mysql",
user = "root",
password = "123456"
local res, err, errno, sqlstate = db:connect(props)
if not res then
ngx.say("connect to mysql error : ", err, " , errno : ", errno, " , sqlstate : ", sqlstate)
return close_db(db)
local drop_table_sql = "drop table if exists test"
res, err, errno, sqlstate = db:query(drop_table_sql)
if not res then
ngx.say("drop table error : ", err, " , errno : ", errno, " , sqlstate : ", sqlstate)
return close_db(db)
local create_table_sql = "create table test(id int primary key auto_increment, ch varchar(100))"
res, err, errno, sqlstate = db:query(create_table_sql)
if not res then
ngx.say("create table error : ", err, " , errno : ", errno, " , sqlstate : ", sqlstate)
return close_db(db)
local insert_sql = "insert into test (ch) values('hello')"
res, err, errno, sqlstate = db:query(insert_sql)
if not res then
ngx.say("insert error : ", err, " , errno : ", errno, " , sqlstate : ", sqlstate)
return close_db(db)
res, err, errno, sqlstate = db:query(insert_sql)
ngx.say("insert rows : ", res.affected_rows, " , id : ", res.insert_id, "&br/&")
local update_sql = "update test set ch = 'hello2' where id =" .. res.insert_id
res, err, errno, sqlstate = db:query(update_sql)
if not res then
ngx.say("update error : ", err, " , errno : ", errno, " , sqlstate : ", sqlstate)
return close_db(db)
ngx.say("update rows : ", res.affected_rows, "&br/&")
local select_sql = "select id, ch from test"
res, err, errno, sqlstate = db:query(select_sql)
if not res then
ngx.say("select error : ", err, " , errno : ", errno, " , sqlstate : ", sqlstate)
return close_db(db)
for i, row in ipairs(res) do
for name, value in pairs(row) do
ngx.say("select row ", i, " : ", name, " = ", value, "&br/&")
ngx.say("&br/&")
--防止sql注入
local ch_param = ngx.req.get_uri_args()["ch"] or ''
--使用ngx.quote_sql_str防止sql注入
local query_sql = "select id, ch from test where ch = " .. ngx.quote_sql_str(ch_param)
res, err, errno, sqlstate = db:query(query_sql)
if not res then
ngx.say("select error : ", err, " , errno : ", errno, " , sqlstate : ", sqlstate)
return close_db(db)
for i, row in ipairs(res) do
for name, value in pairs(row) do
ngx.say("select row ", i, " : ", name, " = ", value, "&br/&")
local delete_sql = "delete from test"
res, err, errno, sqlstate = db:query(delete_sql)
if not res then
ngx.say("delete error : ", err, " , errno : ", errno, " , sqlstate : ", sqlstate)
return close_db(db)
ngx.say("delete rows : ", res.affected_rows, "&br/&")
close_db(db)
对于新增/修改/删除会返回如下格式的响应:
insert_id = 0,
server_status = 2,
warning_count = 1,
affected_rows = 32,
message = nil
affected_rows表示操作影响的行数,insert_id是在使用自增序列时产生的id。
对于查询会返回如下格式的响应:
{ id= 1, ch= "hello"},
{ id= 2, ch= "hello2"}
null将返回ngx.null。
2、example.conf配置文件
location /lua_mysql {
default_type 'text/html';
content_by_lua_file /usr/example/lua/test_mysql.
3、访问如http://192.168.1.2/lua_mysql?ch=hello进行测试,得到如下结果
insert rows : 1 , id : 2
update rows : 1
select row 1 : ch = hello
select row 1 : id = 1
select row 2 : ch = hello2
select row 2 : id = 2
select row 1 : ch = hello
select row 1 : id = 1
delete rows : 2
客户端目前还没有提供预编译SQL支持(即占位符替换位置变量),这样在入参时记得使用ngx.quote_sql_str进行字符串转义,防止sql注入;连接池和之前Redis客户端完全一样就不介绍了。
对于Mysql客户端的介绍基本够用了,更多请参考。
其他如MongoDB等数据库的客户端可以从github上查找使用。
Http客户端
OpenResty默认没有提供Http客户端,需要使用第三方提供;当然我们可以通过ngx.location.capture 去方式实现,但是有一些限制,后边我们再做介绍。
我们可以从github上搜索相应的客户端,比如。
lua-resty-http
1、下载lua-resty-http客户端到lualib
cd /usr/example/lualib/resty/
wget https://raw.githubusercontent.com/pintsized/lua-resty-http/master/lib/resty/http_headers.lua
wget https://raw.githubusercontent.com/pintsized/lua-resty-http/master/lib/resty/http.lua
2、test_http_1.lua
local http = require("resty.http")
--创建http客户端实例
local httpc = http.new()
local resp, err = httpc:request_uri("http://s.taobao.com", {
method = "GET",
path = "/search?q=hello",
headers = {
["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0. Safari/537.36"
if not resp then
ngx.say("request error :", err)
--获取状态码
ngx.status = resp.status
--获取响应头
for k, v in pairs(resp.headers) do
if k ~= "Transfer-Encoding" and k ~= "Connection" then
ngx.header[k] = v
ngx.say(resp.body)
httpc:close()
响应头中的Transfer-Encoding和Connection可以忽略,因为这个数据是当前server输出的。
3、example.conf配置文件
location /lua_http_1 {
default_type 'text/html';
content_by_lua_file /usr/example/lua/test_http_1.
4、在nginx.conf中的http部分添加如下指令来做DNS解析
resolver 8.8.8.8;
记得要配置DNS解析器resolver 8.8.8.8,否则域名是无法解析的。
5、访问如http://192.168.1.2/lua_http_1会看到淘宝的搜索界面。
使用方式比较简单,如超时和连接池设置和之前Redis客户端一样,不再阐述。更多客户端使用规则请参考。
ngx.location.capture
ngx.location.capture也可以用来完成http请求,但是它只能请求到相对于当前nginx服务器的路径,不能使用之前的绝对路径进行访问,但是我们可以配合nginx upstream实现我们想要的功能。
1、在nginx.cong中的http部分添加如下upstream配置
upstream backend {
server s.taobao.
keepalive 100;
即我们将请求upstream到backend;另外记得一定要添加之前的DNS解析器。
2、在example.conf配置如下location
location ~ /proxy/(.*) {
proxy_pass http://backend/$1$is_args$
internal表示只能内部访问,即外部无法通过url访问进来; 并通过proxy_pass将请求转发到upstream。
3、test_http_2.lua
local resp = ngx.location.capture("/proxy/search", {
method = ngx.HTTP_GET,
args = {q = "hello"}
if not resp then
ngx.say("request error :", err)
ngx.log(ngx.ERR, tostring(resp.status))
--获取状态码
ngx.status = resp.status
--获取响应头
for k, v in pairs(resp.header) do
if k ~= "Transfer-Encoding" and k ~= "Connection" then
ngx.header[k] = v
if resp.body then
ngx.say(resp.body)
通过发送一个子请求,此处因为是子请求,所有请求头继承自当前请求,还有如ngx.ctx和ngx.var是否继承可以参考官方文档。 另外还提供了ngx.location.capture_multi用于并发发出多个请求,这样总的响应时间是最慢的一个,批量调用时有用。
4、example.conf配置文件
location /lua_http_2 {
default_type 'text/html';
content_by_lua_file /usr/example/lua/test_http_2.
5、访问如http://192.168.1.2/lua_http_2进行测试可以看到淘宝搜索界面。
我们通过upstream+ngx.location.capture方式虽然麻烦点,但是得到更好的性能和upstream的连接池、负载均衡、故障转移、proxy cache等特性。
不过因为继承在当前请求的请求头,所以可能会存在一些问题,比较常见的就是gzip压缩问题,ngx.location.capture不会解压缩后端服务器的GZIP内容,解决办法可以参考;因为我们大部分这种http调用的都是内部服务,因此完全可以在proxy location中添加proxy_pass_request_来不传递请求头。
浏览 44974
Aceslup 写道test_http_2 代码完全一样,就是测试时是404。搞不懂出错在哪。我得到的是如下错误,感觉backend没有被解析成upstream 里面的 taobaoURL,请问你的问题和我一样吗?解决了吗?404 Not FoundThe requested URL was not found on this server. Sorry for the inconvenience.Please report this message and include the following information to us.Thank you very much!URL: http://backend/search?q=helloServer: aserver.center.et2Date:
23:55:37配置成这样就好了,不然 host一直是backendlocation ~ /proxy/(.*) {&&&&&&&&&&&&&& proxy_pass http://backend/$1$is_args$&&&&&&& proxy_set_header Host&&&&&&&&&&& $&&&&&&& proxy_set_header X-Forwarded-For $remote_&&& }
test_http_2 代码完全一样,就是测试时是404。搞不懂出错在哪。我得到的是如下错误,感觉backend没有被解析成upstream 里面的 taobaoURL,请问你的问题和我一样吗?解决了吗?404 Not FoundThe requested URL was not found on this server. Sorry for the inconvenience.Please report this message and include the following information to us.Thank you very much!URL: http://backend/search?q=helloServer: aserver.center.et2Date:
请问,lua脚本接连mysql,用域名的怎么弄?没有IP的地址,只有域名的。大神求解啊。dns域名解析
local resp, err = red:get("msg")& if not resp then& &&& ngx.say("get msg error : ", err)& &&& return close_reedis(red)& end close_reedis多了一个e~~~ 收到
jinnianshilongnian
浏览量:1843994
浏览量:2328148
浏览量:4681907
浏览量:187960
浏览量:1340050
浏览量:196822
浏览量:4237210
浏览量:504808
浏览量:541641
发现一个问题,请教下:我在access_by_lua_file ...
用testFirstOneSuccessfulStrategy ...
还有一个风险博主可能没提到,在不共享httpclient的情况 ...
纠错:如果请求参数类似于url?role=admin& ...
(window.slotbydup=window.slotbydup || []).push({
id: '4773203',
container: s,
size: '200,200',
display: 'inlay-fix'& nginx php-fpm安装配置
nginx php-fpm安装配置
nginx本身不能处理PHP,它只是个web服务器,当接收到请求后,如果是php请求,则发给php解释器处理,并把结果返回给客户端。
nginx一般是把请求发fastcgi管理进程处理,fascgi管理进程选择cgi子进程处理结果并返回被nginx
本文以php-fpm为例介绍如何使nginx支持PHP
一、编译安装php-fpm
什么是PHP-FPM
PHP-FPM是一个PHP FastCGI管理器,是只用于PHP的,可以在 http://php-fpm.org/download下载得到.
PHP-FPM其实是PHP源代码的一个补丁,旨在将FastCGI进程管理整合进PHP包中。必须将它patch到你的PHP源代码中,在编译安装PHP后才可以使用。
新版PHP已经集成php-fpm了,不再是第三方的包了,推荐使用。PHP-FPM提供了更好的PHP进程管理方式,可以有效控制内存和进程、可以平滑重载PHP配置,比spawn-fcgi具有更多优点,所以被PHP官方收录了。在./configure的时候带 –enable-fpm参数即可开启PHP-FPM,其它参数都是配置php的,具体选项含义可以。
安装前准备
centos下执行
yum -y install gcc automake autoconf libtool make
yum -y install gcc gcc-c++ glibc
yum -y install libmcrypt-devel mhash-devel libxslt-devel
libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel
zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel
ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel
krb5 krb5-devel libidn libidn-devel openssl openssl-devel
yum -y install gcc automake autoconf libtool make&yum -y install gcc gcc-c++ glibc&yum -y install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel
新版php-fpm安装(推荐安装方式)
wget http://cn2.php.net/distributions/php-5.4.7.tar.gz
tar zvxf php-5.4.7.tar.gz
cd php-5.4.7
./configure --prefix=/usr/local/php
--enable-fpm --with-mcrypt
--enable-mbstring --disable-pdo --with-curl --disable-debug
--disable-rpath
--enable-inline-optimization --with-bz2
--with-zlib --enable-sockets
--enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex
--with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli
--with-gd --with-jpeg-dir
make all install
1234567891011
wget http://cn2.php.net/distributions/php-5.4.7.tar.gztar zvxf php-5.4.7.tar.gzcd php-5.4.7./configure --prefix=/usr/local/php&&--enable-fpm --with-mcrypt --enable-mbstring --disable-pdo --with-curl --disable-debug&&--disable-rpath --enable-inline-optimization --with-bz2&&--with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli --with-gd --with-jpeg-dir&make all install
旧版手动打补丁php-fpm安装(旧版程序已经没有了,大家新版的吧,这里做个展示)
wget http://cn2.php.net/get/php-5.2.17.tar.gz
wget http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz
tar zvxf php-5.2.17.tar.gz
gzip -cd php-5.2.17-fpm-0.5.14.diff.gz | patch -d php-5.2.17 -p1
cd php-5.2.17
./configure --prefix=/usr/local/php -with-config-file-path=/usr/local/php/etc
-with-mysql=/usr/local/mysql
-with-mysqli=/usr/local/mysql/bin/mysql_config -with-openssl -enable-fpm -enable-mbstring
-with-freetype-dir -with-jpeg-dir -with-png-dir -with-zlib-dir -with-libxml-dir=/usr -enable-xml
-with-mhash -with-mcrypt -enable-pcntl -enable-sockets
-with-bz2 -with-curl -with-curlwrappers
-enable-mbregex -with-gd -enable-gd-native-ttf -enable-zip -enable-soap -with-iconv -enable-bcmath
-enable-shmop -enable-sysvsem -enable-inline-optimization -with-ldap -with-ldap-sasl -enable-pdo
-with-pdo-mysql
make all install
以上两种方式都可以安装php-fpm,安装后内容放在/usr/local/php目录下
以上就完成了php-fpm的安装。
下面是对php-fpm运行用户进行设置
cd /usr/local/php
cp etc/php-fpm.conf.default etc/php-fpm.conf
vi etc/php-fpm.conf
cd /usr/local/phpcp etc/php-fpm.conf.default etc/php-fpm.confvi etc/php-fpm.conf
user = www-data
group = www-data
如果www-data用户不存在,那么先添加www-data用户
groupadd www-data
useradd -g www-data www-data
二、编译安装nginx
然后按照 安装nginx
三、修改nginx配置文件以支持php-fpm
nginx安装完成后,修改nginx配置文件为,
其中server段增加如下配置,注意标红内容配置,否则会出现No input file specified.错误
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_
include fastcgi_
四、创建测试php文件
创建php文件
在/usr/local/nginx/html下创建index.php文件,输入如下内容
echo phpinfo();
&?php&&&&echo phpinfo();?&
五、启动服务
启动php-fpm和nginx
/usr/local/php/sbin/php-fpm
#手动打补丁的启动方式/usr/local/php/sbin/php-fpm start
sudo /usr/local/nginx/nginx
/usr/local/php/sbin/php-fpm #手动打补丁的启动方式/usr/local/php/sbin/php-fpm start&sudo /usr/local/nginx/nginx
php-fpm关闭重启见文章结尾
六、浏览器访问
访问http://你的服务器ip/index.php,皆可以见到php信息了。
安装php-fpm时可能遇到的错误:
1. php configure时出错
configure: error: XML configuration could not be found
apt-get install libxml2 libxml2-dev
(ubuntu下)
yum -y install libxml2 libxml2-devel(centos下)
apt-get install libxml2 libxml2-dev
(ubuntu下)yum -y install libxml2 libxml2-devel(centos下)
2. Please reinstall the BZip2 distribution
wget http://www.bzip.org/1.0.5/bzip2-1.0.5.tar.gz
tar -zxvf bzip2-1.0.5.tar.gz
cd bzip2-1.0.5
make install
wget http://www.bzip.org/1.0.5/bzip2-1.0.5.tar.gztar -zxvf bzip2-1.0.5.tar.gzcd bzip2-1.0.5makemake install
3. php的配置文件中有一行--with-mysql=/usr。
安装的时候提示:
configure: error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore.
这是由于安装mysql时没有安装mysql头文件,或者是路径指定不正确,php找不到mysql的头文件引起的错误提示。
解决方法。
(1.) 查看你的系统有没有安装mysql header
find / -name mysql.h
如果有。请指定--with-mysql=/跟你的正常路径。
如果没有。请看下一步。
(2.)redhat安装
rpm -ivh MySQL-devel-4.1.12-1.i386.rpm
(3.)ubuntu安装
apt-get install libmysqlclient15-dev
(4.)最后一步php的配置选项添加--with-mysql=/usr即可!
4.No input file specified.
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_
include fastcgi_
5. 如果php configure时缺库,可以先安装库(ubuntu下)
sudo apt-get install make bison flex gcc patch autoconf subversion locate
sudo apt-get install libxml2-dev libbz2-dev libpcre3-dev libssl-dev zlib1g-dev libmcrypt-dev libmhash-dev libmhash2 libcurl4-openssl-dev libpq-dev libpq5 libsyck0-dev
6. mcrypt.h not found. Please reinstall libmcrypt
apt-get install libmcrypt-dev
cd /usr/local/src
wget http://softlayer.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.8.tar.gz
tar -zxvf libmcrypt-2.5.8.tar.gz
cd /usr/local/src/libmcrypt-2.5.8
./configure --prefix=/usr/local
make install
7. php-fpm 5.4.7 如何关闭 重启?
php 5.4.7 下的php-fpm 不再支持 php-fpm 以前具有的 /usr/local/php/sbin/php-fpm (start|stop|reload)等命令,需要使用信号控制:
master进程可以理解以下信号
INT, TERM 立刻终止 QUIT 平滑终止 USR1 重新打开日志文件 USR2 平滑重载所有worker进程并重新载入配置和二进制模块
php-fpm 关闭:
kill -INT cat /usr/local/php/var/run/php-fpm.pid
php-fpm 重启:
kill -USR2 cat /usr/local/php/var/run/php-fpm.pid
查看php-fpm进程数:
ps aux | grep -c php-fpm
8.命令行下执行php,提示找不到命令
-bash: /usr/bin/php: No such file or directory
vi /etc/profile
在文件底部增加一行配置
export PATH=/usr/local/php/bin:$PATH
source /etc/profile
除非注明,本站文章均为: 原创,转载请注明本文地址:
- 646,011 views - 436,486 views - 384,943 views - 254,740 views - 214,764 views - 210,993 views - 181,058 views - 166,198 views - 151,598 views - 136,388 views

我要回帖

更多关于 centos 重装mysql 的文章

 

随机推荐