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