Real PHP Multithreading (not fork or re-process with http) _ PHP Tutorial

Source: Internet
Author: User
Real PHP Multithreading (not fork or re-process with http ). [Plain] # if your autoconfig version is later than 2.59, you can only install php5.4 # otherwise you can only install 5.3.17. If you know your autoconf version, if you have installed php.5.4, you [plain]
# If your autoconfig version is higher than 2.59, you can only install php5.4
# Otherwise, you can only install 5.3.17. If you know the version of your autoconf -- if you have already installed php.5.4, you will install it as 5.4; if you have installed 5.3, you will install 5.3.

#5.4
Wget
Tar zxvf php-5.4.7.tar.gz
Cd php-5.4.7/ext

#5.3
Wget
Tar-xf php-5.3.17.tar.gz
Cd php-5.3.17/ext


# Install pthreads below
Wget https://github.com/krakjoe/pthreads/tarball/master-O pthreads.tar.gz
Tar-xf pthreads.tar.gz
Mv krakjoe-pthreads * pthreads
Cd ../
./Buildconf -- force
./Configure -- enable-maintainer-zts -- enable-pthreads -- prefix =/usr/local/php-threads # Other parameters are configured by yourself. here is only a required parameter
Make
Make install

An example is provided in the source code package, as shown in the following code:

/Usr/local/php-threads/bin/php AdvancedSynchronization. php

[Plain]
Process: running
ScopeTest: 140703850592000 running
ScopeTest2: 140703839512320 running
ScopeTest2: 140703839512320 working...
ScopeTest2: 140703839512320 notified: 1
Process: policying 140703839512320: 1
ScopeTest: 140703850592000 notified: 1
Process: policying 140703850592000: 1

I haven't tried apache execution yet, because I don't want to destroy the existing php environment, and I don't plan to execute it in non-cli mode.

Composer # if your autoconfig version is higher than 2.59, you can only install php5.4 # otherwise you can only install 5.3.17. If you know your autoconf version, if you have installed php.5.4, you...

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.