Linux: Ubuntu Quick notes (2)

Source: Internet
Author: User
Tags install php memcached

Date written: 2016-7-3 18:20:39

Basic content includes: Flash player install, compile and install PHP, write a simple PHP program, java program (Java need to use "Javac" command compiled to execute)

First, the installation of PHP, Flash Player, simple PHP program written

1. Install Flash Player

①, practice using the apt-get method to install:

Execute first:sudo apt-get Update (updated to ensure our software source is up to date)

Re-execute:apt-cache search Flash

Final installation:sudo apt-get install Flashplugin-installer

②,grep command powerful text Search tool in Linux, search in text

Enter a keyword in the (text) file, and then grep the keyword file name

③, "|" The function of the symbol:

[Email protected]:~/file$ ls
comtest.tar.gz test.abc test.asp test.c test.php
[email protected]:~/file$ ls | grep php
Test. PHP

apt-cache Search Flash | grep "^flash" (Regular expressions search for software sources at the beginning of Flash) simply enumerate the results from the beginning of "Flash"

(sudo) apt-get install * * * Y (default installation)

2. Compile and install PHP

Php.net PHP official website after download compile install

www.mysql.com MySQL website download compile and install (about 2 hours)

(A good computer configuration is required to perform the compilation installation)

( later software is best to look for the official website to download, if really do not know to go to Baidu search )

Compile and install generally three steps: Pre-compilation, compile-and-execute installation

CMake (precompiled), make (compile), make install (perform installation)

Note: Ensure that the installed directory has permissions, such as can be placed under the/usr/local/directory. To understand the principle, to find out the details, often error is in some details ~

MySQL configuration file is very important!

Start MySQL Mysqld_safe is a script file, how to execute mysqld, so need to go to execute mysql_safe, do not go directly to execute mysqld

./mysqld--verbose--help | grep CNF

External to the HTTP protocol, not the socket protocol

PS-EF | grep * * View the process named * *

directory/mysql-u root-p (enter password) use the root user to log in to MySQL to change the password

Modified use command: directory/mysql-u root-p password (-p and password without spaces )

3. Simple PHP Program

Second, memcached installation (cache system)

Official website: memcached.org Select the current stable version

Memcached is a cache system

Install dependencies First: sudo apt-get install libevent-dev-y

command-line download installation :

wget http://memcached.org/latest ( not available ) + = After downloading, locate the folder where you

TAR-ZXVF memcached-1.x.x.tar.gz (Unzip)

CD memcached-1.x.x (Open Directory)

./configure--prefix=/usr/local/memcached (Configuration Installation path-precompilation)

make (compile), sudo make install (perform installation)

Run:/usr/local/memcached/bin/memcached-d-M 512-u USERName -L 127.0.0.1-p 11211-c 1024-p/usr/local/memcache D/memcached.pid

View Process: Ps-ef | grep memcached

Set the cache:

Telnet 127.0.0.1 11211

Set name 0 20 6

USERName

Enter will output: STORED

Get Name

The carriage return will output the message name below:

VALUE Name 0 8
USERname
END

Encountered an error:

Client_error Bad Data chunk

is because

Set name 0 6

USERName

The color of the data mismatch caused,USERName is 8 characters, but set name is 6 , change the same!

Set name 0 20 8

USERName

Can!!!

Last update: 2016-7-3 22:46:41

Linux: Ubuntu Quick notes (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.