Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to compile and install php7.3

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to compile and install php7.3", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let Xiaobian take you to learn "how to compile and install php7.3"!

First go to the official website to download the source package (the following are all Alibaba Cloud centos configuration, previously engaged in Tencent Cloud (Cloud), you need to install some additional plug-ins, you can solve Baidu)

I have php7.3.7 tat.gz package.

wget download, tar -xzvf extract

cd into catalogue

./ configure --help View required configuration

I used... configure --prefix=/home/env/php73 --with-config-file-path=/home/env/php73 --enable-fpm --with-mysqli --with-pdo-mysql --enable-mbstring --with-gd --enable-soap --enable-cli --with-curl --with-openssl-dir

Brief description:

--prefix installation path--with-config-file-path configuration file path once compiled is not easy to change, obsessive-compulsive disorder need to be cautious

The rest are the options you need to use. I installed a few basic options.

Then make and make install will show the installation path after installation

Start by running cp php. ini-development/home/env/php73/php.ini under the installation file path

Change date.timezone="Asia/Shanghai"

After entering the installation php path etc, put cp php-fpm.conf.default php-fpm.conf

Enter cd php-fpm.d/

cp www.conf.default www.conf

At this time, you can go to sbin to start php-fpm.

php-fpm restart

killall php-fpm Kill all processes

install Nginx

I installed the latest stable version of http://nginx.org/download/nginx-1.16.0.tar.gz

Unzip and enter directory

./ configure --prefix=/home/env/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre --user=nginx --group=nginx

Make && Make Install

The rest is nginx configuration.

Configure user groups and users

groupadd nginx Create user groups

useradd -s /sbin/nologin -g nginx nginx Create User

About modifying user names or user group names

groupmod -n newname oldname

Authorize the directory. Authorize your project directory too, because my php-fpm is also a walking nginx user.

chown -R nginx:nginx nginx/

About nginx configuration

For management convenience, you can include vhosts, and then configure them in vhosts.

server { listen 80; server_name localhost; root /home/www/test; autoindex on; index index.php index.html index.htm; location / { if (!- e $request_filename) { rewrite ^(.*)$ /index.php? s=/$1 last; break; } } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\. php)(/.*)$; if (!- f $document_root$fastcgi_script_name) { return 404; } fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; } }

Tips:

Can distinguish the name convenient operation

vim ~/.bashrc Then set alias

source ~/.bashrc Refresh

I set up

alias cphp='cd /home/env/php73'alias php=/home/env/php73/bin/phpalias ngre='/home/php/nginx/sbin/nginx -s reload'alias cncv='cd /home/env/nginx/conf/vhosts'alias cwww='cd /home/www'

You can check out my other articles about mysql.

php extension swoole and redis will be shared later

At this point, I believe that we have a deeper understanding of "how to compile and install php7.3," may wish to actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report