博文記錄
PHP 2020-04-04 18:15:47 580 35

今天装了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 ~

 

brand cialis online

2020-05-09 07:49

I was curious if you ever considered changing the layout of your website? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having one or two images. Maybe you could space it out better?

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

http://baskedd.shoppy.pl

2020-07-04 22:40

Epic Reading Youtube Bookflix Youtube

baskedd.shoppy.pl

2020-07-06 08:42

Fahrenheit 451 Movie 2018 Compared To Book Best School Science Experiments

http://zsuuhpb.shoppy.pl/Produkt/libri-righi-emanuele-romagna-sotto-neve7sv

2020-07-11 20:43

Role Of Teachers Wikipedia Writing A Book Blog

books

2020-07-13 22:37

Dystopian Literature Themes Apocalyptic Literature Throughout History

book epub

2020-07-14 17:08

Science Fair Experiments About Gravity Kind Of Oral Literature

pdf

2020-07-14 21:43

Best Books In Audible Education Degree Online

cfoquhp.shoppy.pl

2020-07-15 07:20

Four Agreements Jewelry Education Board Result 2019 Hsc With Marksheet

ebook

2020-07-15 23:25

The Silmarillion Knjiga Clive Cussler Book Quotes

acreooflife.blogspot.com

2020-07-16 20:22

Science Of Stupid Gun Recoil A People'S History Of The United States Good Will Hunting

https://modernavaccinetrial.blogspot.com

2020-07-18 00:14

Romantic Literature Wikipedia Fooled By Randomness Pages

best books

2020-07-22 14:25

Brothers Karamazov Audible Technical Education Essay

best books

2020-07-24 00:47

Algebra 2 Textbook Pdf Redline Tires

https://100politicianswithcoronavirus.blogspot.com/2020/06/tceoirhttps-wwwgooglecom-8274.html

2020-07-25 00:57

Science World Uk Continuing Education Classes Real Estate

books

2020-07-29 19:11

Romantic Period Of English Literature Pdf Grant Medical College Photos

https://nasahubblebirthday.blogspot.com/

2020-07-30 00:16

Science Related News Today English Literature Writers And Their Pen Names

http://cerender.medianewsonline.com/

2020-07-30 13:56

Sarah Jessica Parker Conversations With Friends Fahrenheit 451 Film Trailer Italiano

stocked.atwebpages.com

2020-07-31 02:27

Is Graceling The First Book In The Series Parkinson'S Law Of Triviality Pdf

books

2020-07-31 04:30

The Great American Read Off Department Of Higher Education Uttarakhand

pdf

2020-08-13 21:07

Www.Up Board Result 2018 10th Wuthering Heights Linton

pdf file

2020-08-14 18:23

Never Fade Plot Hindi Literature Short Stories

우리카지노

2020-09-04 12:16

Awesome write-up. I’m a regular visitor of your web site and appreciate you taking the time to maintain the nice site. I will be a frequent visitor for a long time.

바카라

2020-09-04 12:20

It’s really a nice and useful piece of information. I am glad that you shared this helpful info with us. Please keep us informed like this. Thanks for sharing.

예스카지노

2020-09-04 12:23

It is truly a nice and useful piece of info. I am satisfied that you simply shared this useful info with us. Please stay us up to date like this. Thank you for sharing.

https://competentjones.netlify.app/

2020-09-15 23:59

Ecclesiastes Poem Hbse 10th Result 2018 Pdf Download

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