Nginx1.5.2 + PHP5.5.1 + MySQL5.6.10 + Phalcon + Thrift + Composer compile and install in CentOS... Nginx
sudo yum install git gcc make pcre-devel php-devel
========================== The following official installation methods, php installation is not feasible
git clone git://github.com/phalcon/cphalcon.git
cd cphalcon/buildsudo ./install
========================== The above official installation method, php installation is not feasible
If the installation is defined, the php-config directory should be provided; otherwise, phalcon will not be found. it took a lot of time to install it. I went all the way to find information and finally solved the problem. Ah, it's not easy!
git clone git://github.com/phalcon/cphalcon.gitcd /mnt/soft/cphalcon/build/64bits/
/Data/apps/php/bin/phpize ./install./configure --with-php-config=/Data/apps/php/bin
/php-config && make && make install
After installing and modifying php. ini, add the following line:
extension=phalcon.so
Restart the php-fpm process.
Finally, install Thrift. I installed 0.9.0.
This is simple
wget http://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gz
tar zxvf thrift-0.9.0.tar.gz
cd thrift-0.9.0
Install Thrift service together if necessary
Install Thrift extensions supported by php
cd /usr/local/src/thrift-0.9.0/lib/php/src/ext/thrift_protocol/
phpize/Data/apps/php/bin/phpize
./configure --with-php-config=/Data/apps/php/bin/phpize && make && make install
Add extension = thrift_protocol.so
Restart the php-fpm process and restart nginx OK ....
Finally, install Composer.
Introduction
Composer is a dependency management tool in PHP. it allows you to declare the libraries that your project depends on, and then it will install these libraries for you in the project.
Dependency Management
Composer is not the package manager. Yes, it actually deals with "packages" or libraries, but it manages them in projects and installs them to a directory in your project (for examplevendor
). By default, it does not install anything globally. Therefore, it is a dependency manager.
This idea is not new. Composer is inspired by node npm and ruby bundler. However, PHP does not yet have such a tool.
Composer solves the following problems:
A) you have a project that depends on N multiple databases.
B) some of these libraries depend on other libraries.
C) you declare the library on which you are dependent.
D) Composer find out which packages will be installed and then install them (that is, download them to your project ).
Install
Composer contains two major logical parts: one is used to store packages, and the other is a command line application to help you discover, download, update, and share code.
- $ Cd/path/to/my/project
- $ Curl-s http://getcomposer.org/installer | php
In the project list, a composer. phar file contains all the logical code line tools. You can run the following code to determine whether the installation is successful.
- $ Php composer. phar
After this command is executed, all available commands are displayed.
I personally suggest you use this command:
- $ Sudo mv composer. phar/usr/bin/composer
Move this file to the bin directory, which allows you to simplify the command.
- $ Composer about
If you are running on Windows, you can download this file and install it through the PHP parser, wherever you are.