Ubuntu under the PHP development Environment Building, nginx+ (CGI) php5fpm+memcached+xdebug

Source: Internet
Author: User
Tags fpm php development environment

Because it is only the development environment, so is to choose a relatively simple apt-get installation method, but also encountered a little problem in the middle.

First install Nginx

Nginx installation and configuration is actually very simple, nginx itself is very lightweight,

Direct sudo apt-get install Nginx is available.

His profile is inside the/etc/nginx/, the site project path is inside the/var/www, after installation must ensure that Nginx startup account has access to the site directory, or will error.

Step two, install CGI

Linux under the CGI program very much, here I choose is php5-fpm convenient here in fact there is a pit, online a lot of information is said to install CGI after the default port is 9000

, I'm going to make a mistake here.

After installation, add the CGI forwarding configuration to the Nginx servers

Location ~. *\.php?$
{
Include Fastcgi_params;
Fastcgi_pass Unix:/var/run/php5-fpm.sock;
Fastcgi_index index.php;
Fastcgi_param script_filename $document _root$fastcgi_script_name;

}

Red is the place to pay attention to, and other information on the Internet is also different

Save it and then reload the Nginx configuration,

sudo php5-fpm stop;

sudo php5-fpm start;

sudo service nginx reload;

After a few steps, you can basically make sure there's nothing wrong with running PHP.

Then install memcached

sudo apt-get install memcached

After installing the Memcache server, we need to start the service:

Memcached-d-M 128-p 11111-u Root

Read more about this blog

http://wdtxslqnn.blog.163.com/blog/static/44246485201152911188205/

Xdebug Installation

sudo apt-get install Php5-dev php5-cli
#其中php5-dev in order to install XDEBUG, it must be installed.

sudo apt-get install php5-xsl
#Xinc需要xsl extension

sudo apt-get install Php-pear
#pecl the Install must

sudo pecl install Xdebug
#安装xdebug, the installation is complete when the compilation is successful

Then add the PHP Config item

Zend_extension=xdebug.so

And then

sudo php5-fpm stop;

sudo php5-fpm start;

You can see the Xdebug option in Phpinfo ();

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.