> php教程 > php手册 > 본문

在ubuntu机器上部署php测试环境,ubuntu机器部署php

WBOY
풀어 주다: 2016-06-16 09:16:46
원래의
873명이 탐색했습니다.

在ubuntu机器上部署php测试环境,ubuntu机器部署php

在ubuntu机器上部署php测试环境

一、部署环境

Ubuntu11.10_X86_32,编译安装相应的软件:nginx+mysql+php。

二、软件安装

2.1 软件下载

libiconv-1.14.tar.gz

libmcrypt-2.5.7.tar.gz

mcrypt-2.6.8.gz

mhash-0.9.9.9.tar.gz

mysql-5.5.39.tar.gz

nginx-1.1.10.tar.gz

pcre-8.20.tar.gz

php-5.4.34.tar.gz

2.2 环境配置

系统较为纯净要安装一些必要的工具软件

apt-get install gcc g++ ssh automake cmake build-essential autoconf make re2c wget cron bzip2 rcconf flex vim bison m4 mawk cpp binutils libncurses5 unzip tar libncurses5 libncurses5-dev libtool libpcre3 libpcrecpp0 libssl-dev zlibc openssl libxml2-dev libltdl3-dev libpcre3 libpcrecpp0 libssl-dev zlibc openssl libxml2-dev libltdl3-dev libmcrypt-dev

2.3 辅助软件安装

2.3.1 libiconv-1.14.tar.gz

tar zxvf libiconv-1.14.tar.gz

cd libiconv-1.14/

cd libiconv-1.14/

./configure --prefix=/usr/local

make

make install

2.3.2 mhash-0.9.9.9.tar.gz

tar zxvf mhash-0.9.9.9.tar.gz

cd mhash-0.9.9.9

./configure

make

make install

cd ../

2.3.3 libmcrypt-2.5.8.tar.gz

tar zxvf libmcrypt-2.5.8.tar.gz

cd libmcrypt-2.5.8/

./configure

make

make install

/sbin/ldconfig

cd libltdl/

./configure --enable-ltdl-install

make

make install

2.3.4 mcrypt-2.6.8.tar.gz

tar zxvf mcrypt-2.6.8.tar.gz

cd mcrypt-2.6.8/

/sbin/ldconfig

./configure

make

make install

2.3.5 pcre-8.10.tar.gz

tar zxvf pcre-8.10.tar.gz

cd pcre-8.10

./configure

make

make install

2.4 安装mysql

groupadd mysql    #添加mysql组

useradd -g mysql mysql -s /bin/false  #创建用户mysql并加入到mysql组,不允许mysql用户直接登录系统

mkdir -p /data/mysql   #创建MySQL数据库存放目录

chown -R mysql:mysql /data/mysql   #设置MySQL数据库目录权限

tar zxvf mysql-5.5.19.tar.gz

cd mysql-5.5.19

mkdir -p /usr/local/mysql   #创建MySQL安装目录

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql  -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8-unicode_ci -DMYSQL_DATADIR=/usr/local/mysql/data -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DSYSCONFDIR=/etc -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock -DMYSQL_TCP_PORT=3306

make

make install

cp support-files/my-small.cnf /etc/my.cnf

/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

/usr/local/mysql/scripts/mysql_install_db --user=mysql

cd /usr/local/mysql

cp ./support-files/my-huge.cnf /etc/my.cnf   #拷贝配置文件(注意:/etc目录下面默认有一个my.cnf,直接覆盖即可)

vi /etc/my.cnf   #编辑配置文件,在 [mysqld] 部分增加

datadir = /data/mysql  #添加MySQL数据库路径

./scripts/mysql_install_db --user=mysql  #生成mysql系统数据库

cp ./support-files/mysql.server  /etc/rc.d/init.d/mysqld  #把Mysql加入系统启动

chmod 755 /etc/init.d/mysqld   #增加执行权限

启动:bin/mysqld_safe -user=mysql & 

ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql

ln -s /usr/local/mysql/include/mysql /usr/include/mysql

修改密码/usr/local/mysql/bin/mysqladmin -u root -p password "123456"

错误1

解决办法:

2.5 安装php

apt-get install libfreetype6-dev libjpeg8-dev libpng12-dev slapd ldap-utils db5.1-util

apt-get install libldap2-dev libsasl2-dev

./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-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --disable-maintainer-zts

错误1:configure: error: Please reinstall the libcurl distribution -    easy.h should be in /include/curl/

解决方法:apt-get install curl

           apt-get install libcurl4-gnutls-dev

           apt-get install php5-curl

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 추천
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿