CENTOS7 Installing the PHP environment and installing the Swoole

Source: Internet
Author: User

This is only I find a number of solutions on the Internet, to solve the problems I encountered, do a record, buy this server is to test swoole, the results are almost expired, swoole not installed

Thanks https://www.cnblogs.com/phpwechat/p/8417331.html

Https://www.cnblogs.com/zakun/p/5840073.html

52175132

Install httpd (Apache)

1. Installation
yum -y install httpd
2. Open Apache Service
systemctl start httpd.service
3. Set up Apache service boot
systemctl enable httpd.service

Install PHP

Centos/rhel 7.x:

1 RPM-UVH https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm2 RPM-UVH https:// mirror.webtatic.com/yum/el7/webtatic-release.rpm

Centos/rhel 6.x:

1 RPM-UVH https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

2 RPM-UVH https://mirror.webtatic.com/yum/el6/latest.rpm

Yum installation php7.0: (Expand your choice)

1 yum Install Php70w-common php70w-fpm php70w-opcache php70w-gd php70w-mysqlnd php70w-mbstring php70w- pecl-memcached Php70w-devel

The above command installs the following extensions!

Php-api, php-bz2, Php-calendar, Php-ctype, Php-curl, Php-date, Php-exif, Php-fileinfo, Php-filter, Php-ftp, Php-gettext, Php-gmp, Php-hash, Php-iconv, Php-json, Php-libxml, Php-openssl, Php-pcre, php-pecl-fileinfo, php-Pecl-phar, php-Pecl-zip, Php-reflection, Php-session, Php-shmop, Php-simplexml, Php-sockets, PHP-SPL, Php-tokenizer, Php-zend-abi, Php-zip, php-zlib


After installation, you can write a index.php test, my Site directory is in the root directory of var/www/html/write PHP or HTML can

If the written HTML can be accessed by the browser, but PHP directly shows the source code, the Internet is because Apache did not install or associate with the PHP module

Use this command for yum install mod_php71w(79180963)

This shows the source of the problem is OK

Installing Swool

PECL Install Swoole

Install Optional Parameters default NO

enable debug/trace log support?enable sockets supports?enable openssl support?enable http2 support?enable async-redis support? enable mysqlnd support?enable postgresql coroutine client support?




Then modify the php.ini
Increase
extension=swoole.so
Then restart httpd (systemctl restart Httpd.service)

Check
php-m | grep swoole
If the display instructions are installed


Install MySQL and check it out online.
As for the test swoole go to https://wiki.swoole.com/wiki/page/p-quickstart.html

Centos7 Installing the PHP environment and installing swoole

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.