Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Lamp wordpress

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Yum-y install cmake

Yum-y install bison

# install MySQL

Useradd-r-s / sbin/nologin mysql

* add user group mysql, and set mysql user default group to mysql user group

Cd / lamp/mysql-5.5.48

Cmake-DCMAKE_INSTALL_PREFIX=/usr/local/mysql-DMYSQL_UNIX_ADDR=/tmp/mysql.sock-DEXTRA_CHARSETS=all-DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci-DWITH_MYISAM_STORAGE_ENGINE=1-DWITH_INNOBASE_STORAGE_ENGINE=1-DWITH_MEMORY_STORAGE_ENGINE=1-DWITH_READLINE=1-DENABLED_LOCAL_INFILE=1-DMYSQL_USER=mysql-DMYSQL_TCP_PORT=3306

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql installation location

-DMYSQL_UNIX_ADDR=/tmp/mysql.sock specifies the socket (socket) file location

-DEXTRA_CHARSETS=all extended character support

-DDEFAULT_CHARSET=utf8 default character set

-DDEFAULT_COLLATION=utf8_general_ci default character proofreading

-DWITH_MYISAM_STORAGE_ENGINE=1 installs the myisam storage engine

-DWITH_INNOBASE_STORAGE_ENGINE=1 installs the innodb storage engine

-DWITH_MEMORY_STORAGE_ENGINE=1 installs the memory storage engine

-DWITH_READLINE=1 supports readline libraries

-DENABLED_LOCAL_INFILE=1 enables loading of local data

-DMYSQL_USER=mysql specifies the mysql running user

-DMYSQL_TCP_PORT=3306 specifies the mysql port

Make

Make install

Make clean

Rm CMakeCache.txt

# if an error is reported, clear the cache, please use the above command

Cd / usr/local/mysql/

Chown-R root.

Chown-R mysql data

# modify mysql directory permissions

Cp support-files/my-medium.cnf / etc/my.cnf

# copy mysql configuration file

/ usr/local/mysql/scripts/mysql_install_db-- user=mysql

# create database authorization table and initialize database

Start the MySQL service:

1. Use and start mysql in the same way as the original source code

/ usr/local/mysql/bin/mysqld_safe-user=mysql &

two。 It will take effect after the restart:

Vim / etc/rc.local

/ usr/local/mysql/bin/mysqld_safe-user=mysql &

3. Set mysql password

/ usr/local/mysql/bin/mysqladmin-uroot password 123

Clear history command history-c

* add password 123 to mysql user root

* Note that the password cannot be written as "123"

/ usr/local/mysql/bin/mysql-u root-p

Mysql > show databases

Mysql > use test

Mysql > show tables

Mysql >\ s # check whether the character set has been changed to utf8

* use set to change your password after entering mysql

Mysql > exit

* Log in to the MySQL client console to set the specified root password

# install PHP

Before compilation, make sure that the libtool and libtool-ltdl packages are installed on the system. Install:

Yum-y install "libtool*"

Cd / lamp/php-7.0.7

/ configure-- prefix=/usr/local/php/-- with-config-file-path=/usr/local/php/etc/-- with-apxs2=/usr/local/apache2/bin/apxs-- with-libxml-dir=/usr/local/libxml2/-- with-jpeg-dir=/usr/local/jpeg6/-- with-png-dir=/usr/local/libpng/-- with-freetype-dir=/usr/local/freetype/-- with-mcrypt=/usr/local/libmcrypt/ -with-mysqli=/usr/local/mysql/bin/mysql_config-enable-soap-enable-mbstring=all-enable-sockets-with-pdo-mysql=/usr/local/mysql-with-gd-without-pear

If the installation directory is not specified when configuring zlib, do not add the-- with-zlib-dir=/usr/local/zlib/ parameter when configuring PHP.

Options:

-- with-config-file-path=/usr/local/php/etc/ specifies the configuration file directory

-- with-apxs2=/usr/local/apache2/bin/apxs specifies the location of apache dynamic module

-- with-libxml-dir=/usr/local/libxml2/ specifies the libxml location

-- with-jpeg-dir=/usr/local/jpeg6/ specifies the jpeg location

-- with-png-dir=/usr/local/libpng/ specifies the libpng location

-- with-freetype-dir=/usr/local/freetype/ specifies the freetype location

-- with-mcrypt=/usr/local/libmcrypt/ specifies the libmcrypt location

-- with-mysqli=/usr/local/mysql/bin/mysql_config specifies the mysqli location

-- with-gd enables gd libraries

-- enable-soap supports soap services

-- enable-mbstring=all supports multibyte and string

-enable-sockets supports sockets

-- with-pdo-mysql=/usr/local/mysql mysql-enabled pdo module support

-- without-pear does not install pear (Internet connection is required to install pear. PEAR is a PHP extension and application library)

Make

Make install

Generate php.ini

Cp / lamp/php-7.0.7/php.ini-production / usr/local/php/etc/php.ini

# mkdir / usr/local/php/etc/

Test the connectivity between Apache and PHP to see if Apache can parse php files

Vim / usr/local/apache2/etc/httpd.conf

AddType application/x-httpd-php .php .phtml

AddType application/x-httpd-php-source .phps

(pay attention to case)

* .phtml syntax highlighting for .phps as a PHP source file

Restart the Apache service: / usr/local/apache2/bin/apachectl stop

/ usr/local/apache2/bin/apachectl start

* Apache cannot be started, prompting cannot restore segment prot after reloc: Permission denied error. For SELinux problem, you can close SELinux or execute the command chcon-t texrel_shlib_t / usr/local/apache2/modules/libphp5.so.

Test: vim / usr/local/apache2/htdocs/test.php

Enter the address through the browser to access: http://Apache server address / test.php

Default directory of web pages for Rpm package installation / var/www/html/

* sometimes the first browser test will fail. Just close the browser and restart and try again. Non-compilation error

# install openssl

OpenSSL is a powerful secure socket layer cipher library that includes major cryptographic algorithms, commonly used key and certificate encapsulation management functions, and SSL protocols, and provides rich applications for testing or other purposes.

Yum-y install openssl-devel must be installed

Cd / lamp/php-7.0.7/ext/openssl

Mv config0.m4 config.m4 otherwise error: config.m4 not found

/ usr/local/php/bin/phpize

. / configure-with-openssl-with-php-config=/usr/local/php/bin/php-config

Make

Make install

# compile and install memcache

Memcache is a high-performance distributed in-memory object caching system. By maintaining a unified huge hash table in memory, it can be used to store data in various formats, including images, videos, files and database retrieval results. To put it simply, the data is called into memory and then read from memory, thus greatly improving the reading speed.

Https://github.com/websupport-sk/pecl-memcache/archive/php7.zip

Unzip pecl-memcache-php7.zip

Cd pecl-memcache-php7

/ usr/local/php/bin/phpize

. / configure-- with-php-config=/usr/local/php/bin/php-config

Make & & make install

Modify / usr/local/php/etc/php.ini

Extension_dir = "/ usr/local/php/lib/php/extensions/no-debug-zts-20151012/"

# Open comments and modify

Extension= "openssl.so"

Extension= "memcache.so"

# add

# restart apache. You can find this module in phpinfo

# install memcache source code

First install the dependency package libevent

Yum-y install "libevent-devel"

# in the second CD of CentOS 6.3Please change the disk

Umount / mnt/cdrom

# insert the second CD of CentOS 6.3

# mount / dev/sr0 / mnt/cdrom

Cd / lamp/memcached-1.4.17

. / configure-- prefix=/usr/local/memcache

Make & & make install

Useradd memcache

# add a memcache user who does not need to log in or set a password

/ usr/local/memcache/bin/memcached-umemcache &

Netstat-an | grep: 11211

Write self-starting:

Vi / etc/rc.d/rc.local

/ usr/local/memcache/bin/memcached-umemcache &

Project Migration:

1. Copy the php project to the default directory of the website: / usr/local/apache2/htdocs/

2. Establish the database table structure manually.

!

# install phpMyAdmin

Cp-r / lamp/phpMyAdmin-4.1.4-all-languages / usr/local/apache2/htdocs/phpmyadmin

Cd / usr/local/apache2/htdocs/phpmyadmin

Cp config.sample.inc.php config.inc.php

Vim config.inc.php

$cfg ['Servers'] [$I] [' auth_type'] = 'cookie'

$cfg ['Servers'] [$I] [' auth_type'] = 'http'

* set auth_type to http, that is, to HTTP authentication mode

Enter the address through the browser to access: http://Apache server address / phpmyadmin/index.php

The user name is root, and the password is the root password 123456 (lampbrother) specified when MySQL is set.

Import blog

1. Cp-a wordpress / usr/local/apache2/htdocs

Cd / usr/local/apache2/htdocs/

Cd wordpress/

Create a database name in the database

Create a vim wp-config.php in wordpress

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report