Ubuntu php basic environment configuration (including Memcached)-php Tutorial

Source: Internet
Author: User
Ubuntu PHP basic environment configuration (including Memcached) first, it is natural to install Apache

Sudo apt-get install apache2

Then start the service

Sudo/etc/init. d/apache2 start


Then PHP

Sudo apt-get install libapache2-mod-php5 php5

You can continue to install the GD library as needed.

Sudo apt-get install php5-gd

Php5-mysql and other libraries are similar, not listed one by one.


Restart service

Sudo/etc/init. d/apache2 restart


Followed by mysql

Sudo apt-get install mysql-server mysql-client


At this time, the basic environment is OK. You can access http: // 127.0.0.1 to test.



Then continue to install memcached.
Sudo apt-get install memcached

Memcached parameter description
Memcached-d-m 50-p 11211-u root
-M specifies the MB of cache space used,-p specifies the port to be listened on, and-u specifies the user to run

Install the php-memcache module
Sudo apt-get install php5-memcache

Edit configuration file
Sudo vi/etc/php5/conf. d/memcache. ini

; Uncomment the next line to enable the module
Extension = memcache. so

[Memcache]
Memcache. dbpath = "/var/lib/memcache"
Memcache. maxreclevel = 0
Memcache. maxfiles = 0
Memcache. archivememlim = 0
Memcache. maxfilesize = 0
Memcache. maxratio = 0


: Wq! Exit vi.


Check the configured environment in phpinfo!


Backup. If an error occurs during installation, try again.


Uninstall php:

Sudo apt-get autoremove php5-common

Uninstall mysql:

Sudo aptitude purge mysql-server mysql-server-5.0


Force uninstall apache2.2:

$ Sudo apt-get -- purge remove apache2.2-common

$ Sudo apt-get -- purge remove apache2.2

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.