韦德国际_韦德国际1946官方网站_韦德国际1946手机版
做最好的网站

ubuntu编写翻译安装php5,编写翻译安装nginx

日期:2019-06-19编辑作者:韦德国际1946官方网站

参考:

-1. 筹算干活

一、首先下载软件源码包
wget
wget http:/.s135.com/soft/Linux/nginx_php/php/php-5.2.10.tar.gz
wget http:/.s135.com/soft/linux/nginx_php/phpfpm/php-5.2.10-fpm-0.5.11.diff.gz
wget http:/.s135.com/soft/linux/nginx_php/mysql/mysql-5.1.38.tar.gz
wget http:/.s135.com/soft/linux/nginx_php/libiconv/libiconv-1.13.tar.gz
wget http:/.s135.com/soft/linux/nginx_php/mcrypt/libmcrypt-2.5.8.tar.gz
wget http:/.s135.com/soft/linux/nginx_php/mcrypt/mcrypt-2.6.8.tar.gz
wget http:/.s135.com/soft/linux/nginx_php/memcache/memcache-2.2.5.tgz
wget http:/.s135.com/soft/linux/nginx_php/mhash/mhash-0.9.9.9.tar.gz
wget http:/.s135.com/soft/linux/nginx_php/pcre/pcre-7.9.tar.gz
wget http:/.s135.com/soft/linux/nginx_php/eaccelerator/eaccelerator-0.9.5.3.tar.bz2
wget http:/.s135.com/soft/linux/nginx_php/pdo/PDO_MYSQL-1.0.2.tgz
wget http:/.s135.com/soft/linux/nginx_php/imagick/ImageMagick.tar.gz
wget http:/.s135.com/soft/linux/nginx_php/imagick/imagick-2.2.2.tgz
二、安装PHP 5.2.10(FastCGI模式)
1、首先安装PHP 5.2.10所需的支撑库
tar zxvf libiconv-1.13.tar.gz
cd libiconv-1.13/
./configure –prefix=/usr/local
make
make install
cd ..
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure
make
make install
cd ..
#在make中途出错的话, apt-get install g  ,然后再次再做一方面

 

1 CentOS iptables 配置

-1.1 selinux

# 查看
getenforce
# 临时关闭
# 设置SELinux 成为permissive模式
# setenforce 1 设置SELinux 成为enforcing模式
setenforce 0
# 永久关闭
vi /etc/selinux/config

ln -s /usr/local/lib/libmcrypt.la  /usr/lib/libmcrypt.la
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1

 1 1. 手动编译安装 Nginx 1.2.0   2    3   Nginx下载页面:http://nginx.org/en/download.html   4    5      sudo apt-get install -y libpcre3 libpcre3-dev zlib1g-dev   6    7      wget http://nginx.org/download/nginx-1.2.0.tar.gz//如果你没有指定目录,则代表文件下载到自己目前的文件夹   8    9      tar -zxvf nginx-1.2.0.tar.gz  10   11      cd nginx-1.2.0  12   13      ./configure --prefix=/usr/local/nginx  14   15      make  16   17      sudo make install  18   19      sudo ln -s /usr/local/nginx/sbin/nginx /etc/init.d/{开机自动启动}  20   21      sudo /etc/init.d/nginx

 1 #! /bin/sh   2     3 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin   4     5 DESC="nginx daemon"   6 NAME=nginx   『nginx 的安装目录,下面的/etc/nginx都为nginx的安装目录』   7 DAEMON=/etc/nginx/sbin/$NAME   8 CONFIGFILE=/etc/nginx/conf/$NAME.conf     9 PIDFILE=/etc/nginx/logs/$NAME.pid  10 SCRIPTNAME=/etc/init.d/$NAME  11    12 set -e  13 [ -x "$DAEMON" ] || exit 0  14    15 do_start() {  16 $DAEMON -c $CONFIGFILE || echo -n "nginx already running"  17 }  18    19 do_stop() {  20 kill -INT `cat $PIDFILE` || echo -n "nginx not running"  21 }  22    23 do_reload() {  24 kill -HUP `cat $PIDFILE` || echo -n "nginx can't reload"  25 }  26    27 case "$1" in  28 start)  29 echo -n "Starting $DESC: $NAME"  30 do_start  31 echo "."  32 ;;  33 stop)  34 echo -n "Stopping $DESC: $NAME"  35 do_stop  36 echo "."  37 ;;  38 reload|graceful)  39 echo -n "Reloading $DESC configuration..."  40 do_reload  41 echo "."  42 ;;  43 restart)  44 echo -n "Restarting $DESC: $NAME"  45 do_stop  46 do_start  47 echo "."  48 ;;  49 *)  50 echo "Usage: $SCRIPTNAME {start|stop|reload|restart}" >&2  51 exit 3  52 ;;  53 esac  54    55 exit 0

ifcfg-eth0配置

-1.2 firewalld

centos 7 暗许开启的是firewalld防火墙

#停止firewall
systemctl stop firewalld.service 
#禁止firewall开机启动
systemctl disable firewalld.service 
#查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
firewall-cmd --state 

tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
/sbin/ldconfig
./configure
make
make install
cd ..

 

seLinux配置

0. yum 源配置(国内服务器)

//must update yum after os installed
yum update yum

//install wget
yum install -y wget

//备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
//CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
//CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
//CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

// 是上述设置生效
yum makecache

2、编写翻译安装MySQL 5.1.38
增加mysql用户组和用户
/usr/sbin/groupadd mysql
ubuntu编写翻译安装php5,编写翻译安装nginx。/usr/sbin/useradd -g mysql mysql
tar zxvf mysql-5.1.38.tar.gz
cd mysql-5.1.38/
./configure –prefix=/usr/local/webserver/mysql/ –enable-assembler –with-extra-charsets=complex –enable-thread-safe-client –with-big-tables –with-readline –with-ssl –with-embedded-server –enable-local-infile –with-plugins=innobase
make && make install
chmod w /usr/local/webserver/mysql
chown -R mysql:mysql /usr/local/webserver/mysql
cd ..

chmod -R 777 nginx




sudo update-rc.d -f nginx defaults  22   23      访问本机首页 http://localhost/,如果正常,则说明nginx已启动



编译安装php5.4

1 cd php5.4  2 ./configure  3 make (我写的是 make  -f Makefile)  4 make install

2 能源列表 :

1. nginx

  添加nginx yum仓库

vi /etc/yum.repos.d/nginx.repo
//输入内容
[nginx]  
name=nginx repo  
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/  
gpgcheck=0  
enabled=1

// 查看可安装的nginx版本
yum list | grep nginx

韦德国际1946官方网站 1

查看nginx版本

#安装nginx
yum install -y nginx

#启动
service nginx start
#停止
service nginx stop
#重启
service nginx restart
# Nginx配置文件位置
/etc/nginx/nginx.conf  

# 添加开机启动
chkconfig nginx on

  nginx到此设置完结,在浏览器输入服务器IP可以访问到nginx的页面,假设不可能访问,请检查防火墙配置和nginx进度是或不是运维。

#若是编写翻译进度中出现如下错误
#checking for tgetent in -ltermcap… no
#checking for termcap functions library… configure: error: No curses/termcap library found
#注脚 curses/termcap 库未有设置去下载五个ncurses-5.6.tar.gz,
#wget
#tar zxvf ncurses-5.6.tar.gz
#cd ncurses-5.6
# ./configure –prefix=/usr –with-shared –without-debug
# make
# make install clean
#然后再另行编写翻译Mysql进行安装。
#假定又遇到如下错误:
make[2]: *** [do_abi_check] 错误 1
make[2]: Leaving directory `/tmp/mysql-5.5.3-m3′
make[1]: *** [abi_check] 错误 2
make[1]: Leaving directory `/tmp/mysql-5.5.3-m3′
make: *** [all-recursive] 错误 1
#在英特网搜了须臾间,说是Mysql的贰个Bug,消除情势是张开Makefile将do_abi_check:前边的口舌删除,注意do_abi_check:须要留下来,然后再 make && make install

 

mysql5.5.28: 

2. php、php-fpm

附:以下为附加步骤,如若你想在那台服务器上运行MySQL数据库,则实行以下两步。假使您只是希望让PHP帮衬MySQL扩大库,可以再而三别的服务器上的MySQL数据库,那么,以下两步没有要求推行。
1)、创设MySQL数据仓库储存放目录
mkdir -p /var/webserver/mysql/3306/data
chown -R mysql:mysql /var/webserver/mysql/3306

 

 遇到的问题解决如下
   ****make :no targets No targets specified and no makefile found stop 解决办法   2    3     wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.6.tar.gz   4    5     tar zxvf ncurses-5.6.tar.gz   6    7      ./configure -prefix=/usr/local -with-shared -without-debug   8    9     make  10   11     make install

2.1 编译源码安装

2)、以mysql用户帐号的地点创设数据表:
/usr/local/webserver/mysql/bin/mysql_install_db –basedir=/usr/local/webserver/mysql –datadir=/var/webserver/mysql/3306/data –user=mysql

 

php5.4: 

2.1.1 下载源码

// local src 目录存放需要源码文件
cd /usr/local/src/
// 下载最新版php 7.2
wget http://php.net/distributions/php-7.2.0.tar.gz
tar -xvf php-7.2.0.tar.gz

3)、创立my.cnf配置文件:
韦德国际1946官方网站,vim /var/webserver/mysql/3306/my.cnf
输入以下内容:
[client]
default-character-set = utf8
port    = 3306
socket  = /tmp/mysql.sock

 ****The page you are looking for is temporarily unavailable.Please try again later. 
nginx 运行php页面的时候出错

1,修改/etc/nginx/conf/scgi_params/        scgi_param  SCGI              5;

php结合fastcgi访问php页面出错:2012/12/24 14:41:23 [error] 3725#0: *2 open() "/opt/nginx/html/favicon.ico" failed (2: No such file or directory), client: 10.15.62.138, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "10.15.62.120"故障分析:fastcgi的wrapper不能解析php页面

解决办法:::打开nginx配置文件目录conf下的fastcgi_params文件,

           修改fastcgi_param SERVER_SOFTWARE nginx;

nginx 运行php出现,file not found

1,修改/etc/nginx/conf/fastcgi_params 

fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

2,/etc/nginx/conf/nginx.conf

 修改server里面的代码
 root //路径
autoindex on;

      

2.1.2 安装依赖

# configure需要gcc编译
yum install -y gcc

mcrypt:

wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz
tar zxf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure
make && make install

curl:

//https://curl.haxx.se/download/
wget https://curl.haxx.se/download/curl-7.56.0.tar.gz
tar -zxvf curl-7.56.0.tar.gz
cd curl-7.56.0
./configure --prefix=/usr/local/curl
make && make install

要求的依赖包安装:

yum -y install 
    gd-devel 
    zlib-devel 
    libjpeg 
    libjpeg-devel 
    libpng 
    libpng-devel 
    libiconv-devel 
    freetype 
    freetype-devel 
    libmcrypt 
    libmcrypt-devel 
    libxml2 
    libxml2-devel 
    openssl 
    openssl-devel 
    curl-devel 
    libxslt-devel 
    mhash 
    mcrypt 

[mysql]
prompt=”(u:blog.s135.com:)[d]> ”
no-auto-rehash

能够参照他事他说加以考察

nginx: 

2.1.3 编译php

cd php-7.2.0
//
./configure --prefix=/usr/local/php7 
    --with-config-file-path=/usr/local/php7/etc 
    --with-curl=/usr/local/curl 
    --disable-ipv6 
    --with-pdo-mysql 
    --with-openssl 
    --with-openssl-dir 
    --with-pcre-regex 
    --with-kerberos 
    --with-libdir=lib 
    --with-libxml-dir 
    --with-mysqli=shared,mysqlnd 
    --with-pdo-mysql=shared,mysqlnd 
    --with-pdo-sqlite 
    --with-gd 
    --with-iconv 
    --with-zlib 
    --with-xmlrpc 
    --with-xsl 
    --with-pear 
    --with-gettext 
    --with-png-dir 
    --with-jpeg-dir 
    --with-freetype-dir 
    --with-mcrypt 
    --with-mhash 
    --enable-json 
    --enable-mbstring 
    --enable-pdo 
    --enable-mysqlnd 
    --enable-zip 
    --enable-inline-optimization 
    --enable-shared 
    --enable-libxml 
    --enable-xml 
    --enable-bcmath 
    --enable-shmop 
    --enable-sysvsem 
    --enable-mbregex 
    --enable-ftp 
    --enable-gd-native-ttf 
    --enable-pcntl 
    --enable-sockets 
    --enable-soap 
    --enable-session 
    --enable-opcache 
    --enable-fpm 
    --enable-maintainer-zts 
    --enable-fileinfo 
    --enable-gd-jis-conv 
    --with-zlib-dir 

make && make install
// 等待编译安装完成
# 源码目录提供了两个版本的php.ini 
# 
cp /usr/local/src/php-7.2.0/php.ini-production /usr/local/php7/etc/php.ini

// 配置php-fpm
cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf
vi /usr/local/php7/etc/php-fpm.conf
# 找到如下几行,确保如下几行前没有”;” 
pid = run/php-fpm.pid 
error_log = log/php-fpm.log 
log_level = notice 
// php7 新增 php-fpm.d 的子配置文件目录
cd /usr/local/php7/etc/php-fpm.d
cp www.conf.default www.conf
vi www.conf
# 找到以下几行,修改成如下所示的数值
listen = 127.0.0.1:9000 
pm = dynamic 
pm.max_children = 50 
pm.start_servers = 20 
pm.min_spare_servers = 5 
pm.max_spare_servers = 35 
pm.max_requests = 500

## pm表示使用哪种方式,有两个值可以选择,
## 就是static(静态)或者dynamic(动态)。
## 在更老一些的版本中,dynamic被称作apache-like。这个要注意看配置文件的说明。
## 下面4个参数的意思分别为:
## pm.max_children:静态方式下开启的php-fpm进程数量。
## pm.start_servers:动态方式下的起始php-fpm进程数量。
## pm.min_spare_servers:动态方式下的最小php-fpm进程数量。
## pm.max_spare_servers:动态方式下的最大php-fpm进程数量。

应用php自带的php-fpm处理工科具,能够很有利的start,stop,restart
把管理工科具从源码包里放置php7/sbin文件夹里,方便使用

#添加php-fpm到启动项目录
cp /usr/local/src/php-7.2.0/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
#设置php-fpm权限
chmod 755 /etc/init.d/php-fpm
#设置自启动
chkconfig php-fpm on

累加蒙受变量

echo 'export PATH=/usr/local/php7/bin:/usr/local/php7/sbin:$PATH' >> /etc/profile
source /etc/profile
# 这样就能看到版本信息
php -v
PHP 7.2.0 (cli) (built: Dec 30 2017 19:15:52) ( ZTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies

[mysqld]
#default-character-set = utf8
user    = mysql
port    = 3306
socket  = /tmp/mysql.sock
basedir = /usr/local/webserver/mysql
datadir = /var/webserver/mysql/3306/data
open_files_limit    = 10240
back_log = 600
max_connections = 3000
max_connect_errors = 6000
table_cache = 614
external-locking = FALSE
max_allowed_packet = 32M
sort_buffer_size = 2M
join_buffer_size = 2M
thread_cache_size = 300
thread_concurrency = 8
query_cache_size = 32M
query_cache_limit = 2M
query_cache_min_res_unit = 2k
default-storage-engine = MyISAM
default_table_type = MyISAM
thread_stack = 192K
transaction_isolation = READ-COMMITTED
tmp_table_size = 246M
max_heap_table_size = 246M
long_query_time = 1
log_long_format
log-bin = /var/webserver/mysql/3306/binlog
binlog_cache_size = 4M
binlog_format = MIXED
max_binlog_cache_size = 8M
max_binlog_size = 512M
expire_logs_days = 7
key_buffer_size = 256M
read_buffer_size = 1M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_max_extra_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover
skip-name-resolve
#master-connect-retry = 10
slave-skip-errors = 1032,1062,126,1114,1146,1048,1396
server-id = 1
innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 2048M  #倘使开发银行不了Mysql把它改为1024要么增大swap分区的分寸
innodb_data_file_path = ibdata1:1024M:autoextend
innodb_file_io_threads = 4
innodb_thread_concurrency = 8
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 16M
innodb_log_file_size = 128M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
innodb_file_per_table = 0
[mysqldump]
quick
max_allowed_packet = 32M

 

2.1.4 配置PHP session

cd /usr/local/php7/etc
vi php.ini
#搜索 session.save_path , 去掉前面的 ;
session.save_path = "/var/lib/php/session"  ; #此处假定session 保存在 /var/lib/php/session 目录下
#建立目录
mkdir -p /var/lib/php/session
chmod -R 777 /var/lib/php/session/  #更改目录权限

4)、成立管理MySQL数据库的shell脚本:
vim /etc/init.d/mysql
输入以下内容:
#!/bin/sh
mysql_port=3306
mysql_username=”root”
mysql_password=”root”
function_start_mysql()
{
printf “Starting MySQL…n”
/bin/sh /usr/local/webserver/mysql/bin/mysqld_safe –defaults-file=/var/webserver/mysql/${mysql_port}/my.cnf 2>&1 > /dev/null &
}

1 安装mysql 5.6

 1     apt-get install cmake   2    3     apt-get install bison   4    5     apt-get install libncurses5-dev   6    7     cd /etc/mysql5.6   8    9     cmake . -DCMAKE_INSTALL_PREFIX=/etc/mysql5.6/    10   11     make  12   13     make install

jpeg src : 

3. MySql 5.7

下载mysql提供的yum仓库

cd /usr/local
mkdir yumrepo && cd yumrepo
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
# 安装yum源
yum localinstall mysql57-community-release-el7-8.noarch.rpm
# 检查mysql源是否安装成功
yum repolist enabled | grep "mysql.*-community.*"

韦德国际1946官方网站 2

自己研商mysql yum源安装是还是不是成功

# 开始安装
yum install -y 
    mysql-community-server 
    mysql-community-client 
    mysql-community-dever

# 安装成功之后,输入命令启动mysql
service mysqld start
# mysql安装完成之后,在/var/log/mysqld.log文件中给root生成了一个默认密码。
# 通过下面的方式找到root默认密码,然后登录mysql进行修改
grep 'temporary password' /var/log/mysqld.log 

韦德国际1946官方网站 3

查阅私下认可mysql密码

# 用上述密码登录
mysql -uroot -p
# 修改密码
set password for 'root'@'localhost'=password('MyNewPass4!'); 
# 注意:
# mysql5.7默认安装了密码安全检查插件(validate_password),
# 默认密码检查策略要求密码必须包含:
#     大小写字母、数字和特殊符号,并且长度不能少于8位。
# 否则会提示ERROR 1819 (HY000): 
#     Your password does not satisfy the current policy requirements错误

修改密码计策:

# 在/etc/my.cnf文件添加validate_password_policy配置,指定密码策略
# 选择0(LOW),1(MEDIUM),2(STRONG)其中一种,选择2需要提供密码字典文件
validate_password_policy=0
# 如果不需要密码策略,添加my.cnf文件中添加如下配置禁用即可:
validate_password = off

开机运维

# 
chkconfig mysqld on

function_stop_mysql()
{
printf “Stoping MySQL…n”
/usr/local/webserver/mysql/bin/mysqladmin -u ${mysql_username} -p${mysql_password} -S /tmp/mysql.sock shutdown
}

 

 

4. 配置nginx支持php

cd /etc/nginx/
vi nginx.conf
#打开gzip
gzip    on;

配置测试

cd /etc/nginx/conf.d
vi test.conf

填入以下内容:

server {
    listen       8090;
    server_name  localhost;

    location / {
        ssi on;
        ssi_silent_errors on;
        ssi_types text/shtml;
        root   /mnt/www/test;
        index  index.html index.htm index.php;
        if ( !-e $request_filename ) {
            rewrite ^(.*)$ /index.php?url=$1 last;
        }

    }
    location ~.php$ {
        root           /mnt/www/test;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
    location ~.(jpg|jpeg|png|js|css) {
        root /mnt/www/test;
        expires 30d;
    }
}

在/mnt/www/test 目录下新建index.php, 输入以下内容:

<?php
phpinfo();
?>

下一场访问服务器的8090端口。即使能展现php信息。则布署落成

function_restart_mysql()
{
printf “Restarting MySQL…n”
function_stop_mysql
sleep 5
function_start_mysql
}

 

下载pcre (支持nginx伪静态)
 

5. phpMyAdmin

function_kill_mysql()
{
kill -9 $(ps -ef | grep ‘bin/mysqld_safe’ | grep ${mysql_port} | awk ‘{printf $2}’)
kill -9 $(ps -ef | grep ‘libexec/mysqld’ | grep ${mysql_port} | awk ‘{printf $2}’)
}


CMAKE:

5.1 安装php扩展mysqli和pdo_mysql

韦德国际1946官方网站 4

php扩充在源码的ext目录下

# 编译 mysqli
cd /usr/local/src/php-7.2.0/ext/mysqli
# 执行这句命令在mysqli目录下生成configure
/usr/local/php7/bin/phpize
# 
./configure 
    --with-php-config=/usr/local/php7/bin/php-config 
    --enable-embedded-mysqli=shared 
    --enable-shared
#
make && make install
# 编译完成之后会在 /usr/local/php7/lib/php/extensions/no-debug-zts-20170718
# 目录下生成*.so 文件

# 编译 pdo_mysql
cd /usr/local/src/php-7.2.0/ext/pdo_mysql
/usr/local/php7/bin/phpize
# php7 pdo只需要连接mysqlnd驱动即可
./configure 
    --with-php-config=/usr/local/php7/bin/php-config 
    --with-pdo-mysql=mysqlnd
make && make install

编写翻译达成之后要求在php.ini 中载入这几个extensions

cd /usr/local/php7/etc
vi php.ini
#添加下面内容
extension_dir = "/usr/local/php7/lib/php/extensions/no-debug-zts-20170718"
extension = mysqli.so 
extension = pdo_mysql.so 

if [ "$1" = "start" ]; then
function_start_mysql
elif [ "$1" = "stop" ]; then
function_stop_mysql
elif [ "$1" = "restart" ]; then
function_restart_mysql
elif [ "$1" = "kill" ]; then
function_kill_mysql
else
printf “Usage: /var/webserver/mysql/${mysql_port}/mysql {start|stop|restart|kill}n”
fi

libmcrypt: ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz

5.2 获取并安装phpMyAdmin

#
cd /usr/local/src
wget https://files.phpmyadmin.net/phpMyAdmin/4.7.7/phpMyAdmin-4.7.7-all-languages.tar.gz
mv ***

修改phpMyAdmin配置文件

cd /mnt/www/phpMyAdmin
cp config.sample.inc.php config.inc.php
vi config.inc.php

#这里的内容随意设置,在cookie访问模式下不能为空
$cfg['blowfish_secret'] = 'www.oschina.com';  
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
 #重要,这里设置成localhost有可能会出现
$cfg['Servers'][$i]['host'] = '127.0.0.1'; phpMyAdmin无法访问数据库
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '******';  #这里设置数据库的密码

配置nginx

cd /etc/nginx/conf.d
vi phpmyadmin.conf

server {
    listen       9090;
    server_name  localhost;

    location / {
        ssi on;
        ssi_silent_errors on;
        ssi_types text/shtml;
        root   /mnt/www/phpMyAdmin;
        index  index.html index.htm index.php;
        if ( !-e $request_filename ) {
            rewrite ^(.*)$ /index.php?url=$1 last;
        }

    }
    location ~.php$ {
        root           /mnt/www/phpMyAdmin;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
    location ~.(jpg|jpeg|png|js|css) {
        root /mnt/www/phpMyAdmin;
        expires 30d;
    }
}

重启 nginx php-fpm mysqld 服务之后,输入9090端口就足以访问了。

5)、增添实施权限
sudo chmod x /etc/init.d/mysql

3 安装依赖库:

6)、加多mysql服务(ubuntu),并运转服务增添自定义shell命令
#添加mysql服务
sudo update-rc.d mysql defaults 100

yum ``install``make``apr* autoconf automake curl curl-devel gcc gcc-c zlib-devel openssl openssl-devel pcre-devel gd kernel keyutils patch perl kernel-headers compat* mpfr cpp glibc libgomp libstdc -devel ppl cloog-ppl keyutils-libs-devel libcom_err-devel libsepol-devel libselinux-devel krb5-devel zlib-devel libXpm* freetype libjpeg* libpng* php-common php-gd ncurses* libtool* libxml2 libxml2-devel patch libevent-devel php-devel【支持phpize】

#启动mysql服务
service mysql start

 

#拉长自写义shell命令,方便进入mysql
sudo vim ~/.bashrc
#在结尾一行到场以下内容
mysql () {
/usr/local/webserver/mysql/bin/mysqlr
}

4   安装CMAKE (不自然供给) ,libmcrypt,FreeType(安装gd时候要求) ,PCRE 

#让其及时生效
source ~/.bashrc

7)、登入mysql以上加多好之后,直接输入mysql就能够登入进去了

tar zxvf freetype-2.4.11*

8)、输入以下SQL语句,创造二个怀有root权限的用户
GRANT ALL PRIVILEGES ON *.* TO ‘root’@'localhost’ IDENTIFIED BY ”;
GRANT ALL PRIVILEGES ON *.* TO ‘root’@’127.0.0.1′ IDENTIFIED BY ”;

./configure 

3、编写翻译安装PHP(法斯特CGI形式)
tar zxvf php-5.2.10.tar.gz
gzip -cd php-5.2.10-fpm-0.5.11.diff.gz | patch -d php-5.2.10 -p1
cd php-5.2.10/
./configure –prefix=/usr/local/webserver/php –with-config-file-path=/usr/local/webserver/php/etc –with-mysql=/usr/local/webserver/mysql –with-mysqli=/usr/local/webserver/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 –without-pear

./configure --prefix=/usr/local/freetype

#如若出现上边的谬误提醒
#checking for xml2-config… no
#checking for xml-config… no
#configure: error: XML configuration could not be found
#安装  apt-get install libxml2-dev
#假设出现上面包车型大巴错误提醒
#checking for pkg-config… /usr/bin/pkg-config
#configure: error: Cannot find OpenSSL’s <evp.h>
#安装   apt-get install libssl-dev”
#假诺现身上面包车型客车不当提醒
#checking for cURL in default path… not found
#configure: error: Please reinstall the libcurl distribution –  easy.h should be in <curl-dir>/include/curl/
#安装:  apt-get install libcurl4-gnutls-dev
#比如出现:
#configure: error: libjpeg.(a|so) not found.
#安装:  apt-get install libjpeg-dev
#一旦出现:
#configure: error: libpng.(a|so) not found.
#安装:  apt-get install libpng12-dev
#若果出现:configure: error: freetype.h not found.
#安装:  apt-get install libfreetype6-dev
#假诺出现:configure: error: sasl.h not found!
#安装:  apt-get install libsasl2-dev
借使出现:

make && make install

——————————————————————–

  

|                       *** ATTENTION ***                            |

5 安装libjpeg 

|                                                                    |

  不亮堂怎么第三部并未有装上libjpeg的扶助,不得不再一次编写翻译php

| Something is likely to be messed up here, because the configure    |

| script was not able to detect a simple feature on your platform.   |

tar zxvf jpegsrc.v9.*

| This is often caused by incorrect configuration parameters. Please |

cd jpegv9

| see the file debug.log for error messages.                         |

./configure --prefix=/usr/local/jpeg9/ --enable-shared --enable-static

|                                                                    |

make && make install

| If you are unable to fix this, send the file debug.log to the      |

  安装 libpng

| php-install@lists.php.net mailing list and include appropiate      |

 

| information about your setup.                                      |

6 安装gd2

——————————————————————–

| License:                                                           |

| This software is subject to the PHP License, available in this     |

tar zxvf gd-2.1.0-preview.tar.gz

| distribution in the file LICENSE.  By continuing this installation |

./configure --prefix=/usr/local/gd --with-jpeg=/usr/local/jpeg9/ --with-png=/usr/local/libpng/ --with-zlib --with-freetype=/usr/local/freetype/

| process, you are bound by the terms of this license agreement.     |

make && make install

| If you do not agree with the terms of this license, you must abort |

 

| the installation process at this point.                            |

本文由韦德国际发布于韦德国际1946官方网站,转载请注明出处:ubuntu编写翻译安装php5,编写翻译安装nginx

关键词: bv1946伟德国际 系统运维