博文記錄
PHP 2020-04-04 18:15:47 1512 21

今天装了debian,记录一些在debian平台上编译安装PHP7的问题。

通过参考之前的CentOS安装方式,修改部分参数以及替换其对应的开发库依赖。

 

注意事项:

  1. 在centos上是***-devel的,在debian上是***-dev 这样子的。
  2. 关于lib库指向,centos是lib64,debian是lib

 

预先安装依赖

这些都是根据centos相关所需的库给转换过去的,如果以下没有完全包含你所缺少的开发库,则通过configure时报的具体错误,在google进行搜寻,找到具体的开发库并安装就好了。

需要注意的是,我们编译时常常所需的库均是开发库,**-dev 或者 **-devel 这样子的。不用安装程序。

拿缺少libzip举例:

apt install -y libzip

apt install -y libzip-dev

有的教程会告诉你两个全装了,其实大部分情况在编译时我们只需要后者而已。

apt-get install -y zlib1g-dev
apt-get install -y libjpeg-dev
apt-get install -y libpng-dev
apt-get install -y libwebp-dev
apt-get install -y autoconf g++ make openssl libssl-dev libcurl4-openssl-dev
apt-get install -y libcurl4-openssl-dev pkg-config
apt-get install -y libsasl2-dev
apt-get install -y libzip-dev

apt-get install -y libldb-dev libldap2-dev
ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so \
&& ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so

 

php7.4特有的依赖,如果是PHP7.4你需要下面这些。

apt install -y libsqlite3-dev
apt install -y libonig-dev

 

完整配置

关于参数变更详参:

https://www.php.net/manual/en/migration74.other-changes.php#migration74.other-changes.pkg-config

PHP7.4

wget http://php.net/get/php-7.4.4.tar.gz/from/this/mirror -O php-7.4.4.tar.gz
tar -xzf php-7.4.4.tar.gz -C ./
cd php-7.4.4
./configure --prefix=/usr/local/php/php7.4.4/\
 --with-config-file-path=/usr/local/php/php7.4.4/\
 --with-libdir=lib\
 --enable-fpm\
 --enable-gd\
 --enable-gd-jis-conv\
 --with-fpm-user=www\
 --with-fpm-group=www\
 --enable-mysqlnd\
 --with-pdo-mysql=mysqlnd\
 --enable-opcache\
 --enable-pcntl\
 --enable-mbstring\
 --enable-soap\
 --enable-calendar\
 --enable-bcmath\
 --enable-exif\
 --enable-ftp\
 --enable-intl\
 --enable-sockets\
 --with-openssl\
 --with-zlib\
 --with-curl\
 --with-gettext\
 --with-mhash\
 --with-webp\
 --with-jpeg\
 --with-ldap\
 --with-zip

 

进行编译

make && make install 

复制配置文件

cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
cp php.ini-production  /usr/local/php/php7.4.4/php.ini
cp /usr/local/php/php7.4.4/etc/php-fpm.conf.default /usr/local/php/php7.4.4/etc/php-fpm.conf
cp /usr/local/php/php7.4.4/etc/php-fpm.d/www.conf.default /usr/local/php/php7.4.4/etc/php-fpm.d/www.conf

 

写入执行权限

chmod +x /etc/init.d/php-fpm

重载系统服务,否则无法使用systemctl进行管理

systemctl daemon-reload

启动php-fpm

systemctl start php-fpm

停止php-fpm

systemctl stop php-fpm

增加到开启自启

systemctl enable php-fpm

 

Enjoy ~

 

free trial cialis online

2020-06-12 09:35

May I simply just say what a relief to find someone that actually understands what they're talking about online. You definitely realize how to bring a problem to light and make it important. A lot more people need to read this and understand this side of your story. I was surprised that you're not more popular since you definitely possess the gift.

plohed.shoppy.pl

2020-06-26 05:42

Role Of Action Research In Education Higher School Of Economics Application

https://crexbooks.blogspot.com/

2020-06-27 14:43

Rte Education Admission 2019 Gay Literature Awards

best books

2020-06-28 00:27

Fahrenheit 451 Filme 2018 Critica Redeeming Love Gospel Song

stremmys.shoppy.pl

2020-06-30 04:13

Central Board Of Secondary Education Class X Penguin Classics Dostoevsky

dizzanov.blogaaja.fi

2020-06-30 15:42

Best English Poets Of India Transmetropolitan Hq Download

xarelto.shoppy.pl

2020-07-01 06:17

Scientific Articles Editing Cbse Official Website Question Paper

breddiop.shoppy.pl

2020-07-01 14:36

Holt Mcdougal Literature Grade 7 Science Daily Genetics

best books

2020-07-02 11:44

Out Of Print Epic Collections The Red Queen Genetics

danceree.shoppy.pl

2020-07-02 19:50

Nancy Drew Books Malaysia Turtles All The Way Down In French

pdf list

2021-03-30 17:50

Arthur Rackham Jigsaw Puzzles Good Omens Amazon Box

inbooks.atthost24.pl

2021-03-31 15:44

Little Red Hen Reply Frontiers In Plant Science Reputation

pdf book

2021-04-01 02:11

Jacqueline Wilson Books Opal Plumstead The Secret Language Of Birthdays Gary Goldschneider Free Download

best books

2021-04-01 18:44

Political Science Literature Literature Education Meaning In Urdu

http://baringbooker.nstrefa.pl

2021-04-02 14:27

Amazon Uk Books Hilary Mantel Acharya College Near Jalahalli Cross

bog

2021-04-21 02:16

Museum Of Science And Industry Venue Hire Gothic Novel Victor

rannewsnextces1984.netlify.app

2021-04-21 11:23

Station Eleven Emily St John Formal Education Meaning In Marathi

https://readerallbooks.godaddysites.com/f/the-hanging-tree

2021-06-15 04:31

Chuck Klosterman Downtown Owl Strike The Cuckoo'S Calling How Many Episodes

pdf book

2021-07-03 09:24

Mo Willems Voice Acting Chuck Palahniuk Vs Charles Bukowski

https://kanyon957.blogaaja.fi/

2021-07-04 02:50

Scientific Thinking Model Skellig Rock

Frenchmxjf

2022-03-23 13:53

Thе wise рerson fеels thе pain of оne arrоw. Thе unwisе fееls thе pain of two.

發表評論
StudioEIM - 冒险者讲习所
0:00