LAMP搭建
安装php时,需要指定mysql安装目录,也需要指定apache的apxs工具,安装顺序可以是amp、map
另外需要注意的是:php是apache的一个模块
apache、mysql各需要一个用户监听
相关资料:
http://www.apelearn.com/study_v2/download.html
https://github.com/aminglinux/resource/wiki
mysql安装:
mysql官网:http://dev.mysql.com/downloads
不用源码包的原因:tar.gz方便不用编译,性能好
1.下载mysql到/usr/local/src/:
wget http://mirrors.sohu.com/mysql/MySQL-5.1/mysql-5.1.73-linux-i686-glibc23.tar.gz
2.解压(-zxvf的-可省略)
tar zxvf mysql-5.1.73-linux-i686-glibc23.tar.gz
3.把解压完的数据移动到/usr/local/mysql
mv mysql-5.1.73-linux-i686-glibc23 /usr/local/mysql #mysql目录可不存在
4.建立mysql用户
useradd -s /sbin/nologin mysql #一个服务进程依靠用户(mysql)运行,即该用户监听此服务进程
5.初始化数据库
mkdir -p /data/mysql; chown -R mysql /data/mysql #数据库的数据是需要mysql写的,文件或目录默认的用户为当前用户其他普通用户无写权限
cd /usr/local/mysql/;./scripts/mysql_install_db --user=mysql --datadir=/data/mysql #datadir为mysql数据目录;
6.判断初始化是否成功
echo $? #返回值为0说明正确
7.拷贝配置文件
cp /usr/local/mysql/support-files/my-large.cnf /etc/my.cnf #系统安装可能安装了mysql,故可能会提示覆盖文件
8.拷贝启动脚本文件并修改其属性(/etc/init.d系统服务目录)
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
9.修改启动脚本(用来启动和停止mysql)
vim /etc/init.d/mysqld #basedir为mysql程序目录
10.把启动脚本加入系统服务项,并设定开机启动(还可以把/etc/init.d/mysqld start命令加入到/etc/rc.local文件),启动mysql
chkconfig --add mysqld;chkconfig mysqld on;/etc/init.d/mysqld start
11.vim /etc/profile.d/path.sh #把mysql命令加入环境变量
#!/bin/bash export PATH=$PATH:/usr/local/mysql/bin
source /etc/profile #把目录/etc/profile、/etc/profile.d/的文件执行一次
ps aux | grep mysqld
root 949 0.0 0.1 5124 1364 ? S Mar18 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/data/mysql --pid-file=/data/mysql/iZ28g7mpz93Z.pid mysql 1091 0.0 5.8 414200 60528 ? Sl Mar18 4:13 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/mysql --user=mysql --log-error=/data/mysql/iZ28g7mpz93Z.err --pid-file=/data/mysql/iZ28g7mpz93Z.pid --socket=/tmp/mysql.sock --port=3306 root 31259 0.0 0.0 4356 712 pts/0 S+ 20:53 0:00 grep mysqld
netstat -lnp | grep mysqld
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1091/mysqld
unix 2 [ ACC ] STREAM LISTENING 9253 1091/mysqld /tmp/mysql.sock
apache安装:
apache官网:http://www.apache.org/
1.下载apach到/usr/local/src/(2.2和2.4安装时可能有点不同)
wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.31.tar.gz
2.解压
tar zxvf httpd-2.2.31.tar.gz
cd httpd-2.2.31
3.配置编译参数:
vim INSTALL #查看安装指导
4.为了避免在make的时候出现错误,提前先安装好一些库文件: #gcc是c语言编译器
yum install -y gcc pcre pcre-devel apr apr-devel zlib-devel
5.配置编译参数:#如果configure错误,make clean,再重新configure
./configure是源代码安装的第一步,主要的作用是对即将安装的软件进行配置,检查当前的环境是否满足要安装软件的依赖关系,但并不是所有的tar包都是源代码的包
cd httpd-2.2.31
./configure \ --prefix=/usr/local/apache2 \#apach安装目录 --with-included-apr \#apr支持httpd跨平台 --enable-so \ --enable-deflate=shared \#动态共享模式安装 --enable-expires=shared \#动态共享模式安装 --enable-rewrite=shared \#动态共享模式安装 --with-pcre #正则相关,支持伪静态
6.make;echo $? #出错会出现error
7.make install;echo $?
8.vim /etc/profile.d/path.sh #把apachectl命令加入环境变量
/usr/local/apache/bin/apachectl
apachectl start 启动apache
经分析发现是apache的conf目录下的配置文件httpd.conf中关于hostname设置和/etc/sysconfig/network中的HOSTNAME设置不统一导致的,修改成统一的主机名即可解决该问题。
apachectl restart
ps aux | grep httpd
root 7058 0.0 1.2 28864 12468 ? Ss Mar18 0:42 /usr/local/apache/bin/httpd -k start daemon 30804 0.0 1.0 28996 10876 ? S 13:12 0:00 /usr/local/apache/bin/httpd -k start daemon 30932 0.0 1.0 28996 10864 ? S 15:56 0:00 /usr/local/apache/bin/httpd -k start daemon 30949 0.0 1.0 28996 10856 ? S 16:06 0:00 /usr/local/apache/bin/httpd -k start daemon 30950 0.0 1.0 28996 10856 ? S 16:06 0:00 /usr/local/apache/bin/httpd -k start daemon 31143 0.0 1.0 28996 10860 ? S 19:51 0:00 /usr/local/apache/bin/httpd -k start daemon 31144 0.0 1.0 28996 10864 ? S 19:51 0:00 /usr/local/apache/bin/httpd -k start daemon 31155 0.0 1.0 28996 10860 ? S 19:53 0:00 /usr/local/apache/bin/httpd -k start daemon 31188 0.0 1.0 28996 10856 ? S 20:12 0:00 /usr/local/apache/bin/httpd -k start daemon 31189 0.0 1.0 28996 10856 ? S 20:12 0:00 /usr/local/apache/bin/httpd -k start daemon 31190 0.0 1.0 28996 10860 ? S 20:12 0:00 /usr/local/apache/bin/httpd -k start root 31251 0.0 0.0 4356 732 pts/0 S+ 20:49 0:00 grep httpd
netstat -lnp | grep httpd
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 7058/httpd
apachectl -M
/usr/local/apache/bin/apachectl -l #列出静态模块
Compiled in modules: core.c mod_authn_file.c mod_authn_default.c mod_authz_host.c mod_authz_groupfile.c mod_authz_user.c mod_authz_default.c mod_auth_basic.c mod_include.c mod_filter.c mod_log_config.c mod_env.c mod_setenvif.c mod_version.c prefork.c http_core.c mod_mime.c mod_status.c mod_autoindex.c mod_asis.c mod_cgi.c mod_negotiation.c mod_dir.c mod_actions.c mod_userdir.c mod_alias.c mod_so.c
vim /usr/local/apache/conf/httpd.conf#apach配置文件
#apache进程的用户是daemon
修改
9./usr/local/apache/bin/apachectl graceful #和重启效果一样,但不杀死进程,只重新加载配置文件
php编译安装:
5.4是企业常用版本
1.下载php到/usr/local/src/:
wget http://cn2.php.net/get/php-5.4.45.tar.bz2/from/this/mirror
2.解压:
tar jxvf php-5.4.45.tar.bz2
cd php-5.4.45
3.配置编译参数:(这一步可能会遇到很多错误,一般是缺库文件)
yum install -y libjpeg libjpeg-devel; yum install -y libpng libpng-devel; yum install -y freetype freetype-devel; yum install -y bzip2 bzip2-devel; yum install -y openssl openssl-devel; rpm -ivh "http://www.aminglinux.com/bbs/data/attachment/forum/month_1211/epel-release-6-7.noarch.rpm"; yum install -y libmcrypt-devel yum install -y libxml2-devel
./configure \ --prefix=/usr/local/php \ --with-apxs2=/usr/local/apache/bin/apxs \ --with-config-file-path=/usr/local/php/etc \ --with-mysql=/usr/local/mysql \ --with-libxml-dir \ --with-gd \ --with-jpeg-dir \ --with-png-dir \ --with-freetype-dir \ --with-iconv-dir \ --with-zlib-dir \ --with-bz2 \ --with-openssl \ --with-mcrypt \ --enable-soap \ --enable-gd-native-ttf \ --enable-mbstring \ --enable-sockets \ --enable-exif \ --disable-ipv6
终于成功了。。
4.编译:
make;echo $?
5.安装:
make install;echo $?
6.拷贝配置文件:
cp php.ini-production /usr/local/php/etc/php.ini
/usr/local/php/bin/php -m #查看php模块,一般是静态模块,php也有动态模块需要自己编译
[PHP Modules]
bz2
Core
ctype
date
dom
ereg
exif
fileinfo
filter
gd
hash
iconv
json
libxml
mbstring
mcrypt
mysql
openssl
pcre
PDO
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zlib
[Zend Modules]
/usr/local/php/bin/php -i #查看php配置信息
phpinfo() PHP Version => 5.4.45 System => Linux iZ28g7mpz93Z 2.6.32-431.23.3.el6.i686 #1 SMP Thu Jul 31 14:37:53 UTC 2014 i686 Build Date => Mar 17 2016 22:24:43 Configure Command => './configure' '--prefix=/usr/local/php' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-config-file-path=/usr/local/php/etc' '--with-mysql=/usr/local/mysql' '--with-libxml-dir' '--with-gd' '--with-jpeg-dir' '--with-png-dir' '--with-freetype-dir' '--with-iconv-dir' '--with-zlib-dir' '--with-bz2' '--with-openssl' '--with-mcrypt' '--enable-soap' '--enable-gd-native-ttf' '--enable-mbstring' '--enable-sockets' '--enable-exif' '--disable-ipv6' Server API => Command Line Interface Virtual Directory Support => disabled Configuration File (php.ini) Path => /usr/local/php/etc Loaded Configuration File => /usr/local/php/etc/php.ini Scan this dir for additional .ini files => (none) Additional .ini files parsed => (none) PHP API => 20100412 PHP Extension => 20100525 Zend Extension => 220100525 Zend Extension Build => API220100525,NTS PHP Extension Build => API20100525,NTS Debug Build => no Thread Safety => disabled Zend Signal Handling => disabled Zend Memory Manager => enabled Zend Multibyte Support => provided by mbstring IPv6 Support => disabled DTrace Support => disabled Registered PHP Streams => https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv3, sslv2, tls Registered Stream Filters => zlib.*, bzip2.*, convert.iconv.*, mcrypt.*, mdecrypt.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk This program makes use of the Zend Scripting Language Engine: Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies _______________________________________________________________________ Configuration bz2 BZip2 Support => Enabled Stream Wrapper support => compress.bzip2:// Stream Filter support => bzip2.decompress, bzip2.compress BZip2 Version => 1.0.5, 10-Dec-2007 Core PHP Version => 5.4.45 Directive => Local Value => Master Value allow_url_fopen => On => On allow_url_include => Off => Off always_populate_raw_post_data => Off => Off arg_separator.input => & => & arg_separator.output => & => & asp_tags => Off => Off auto_append_file => no value => no value auto_globals_jit => On => On auto_prepend_file => no value => no value browscap => no value => no value default_charset => no value => no value default_mimetype => text/html => text/html disable_classes => no value => no value disable_functions => phpinfo,eval,passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog, => phpinfo,eval,passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog, display_errors => Off => Off display_startup_errors => Off => Off doc_root => no value => no value docref_ext => no value => no value docref_root => no value => no value enable_dl => Off => Off enable_post_data_reading => On => On error_append_string => no value => no value error_log => php_errors.log => php_errors.log error_prepend_string => no value => no value error_reporting => 32759 => 32759 exit_on_timeout => Off => Off expose_php => On => On extension_dir => /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525 => /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525 file_uploads => On => On highlight.comment => <font style="color: #FF8000">#FF8000</font> => <font style="color: #FF8000">#FF8000</font> highlight.default => <font style="color: #0000BB">#0000BB</font> => <font style="color: #0000BB">#0000BB</font> highlight.html => <font style="color: #000000">#000000</font> => <font style="color: #000000">#000000</font> highlight.keyword => <font style="color: #007700">#007700</font> => <font style="color: #007700">#007700</font> highlight.string => <font style="color: #DD0000">#DD0000</font> => <font style="color: #DD0000">#DD0000</font> html_errors => Off => Off ignore_repeated_errors => Off => Off ignore_repeated_source => Off => Off ignore_user_abort => Off => Off implicit_flush => On => On include_path => .:/usr/local/php/lib/php => .:/usr/local/php/lib/php log_errors => On => On log_errors_max_len => 1024 => 1024 mail.add_x_header => On => On mail.force_extra_parameters => no value => no value mail.log => no value => no value max_execution_time => 0 => 0 max_file_uploads => 20 => 20 max_input_nesting_level => 64 => 64 max_input_time => -1 => -1 max_input_vars => 1000 => 1000 memory_limit => 128M => 128M open_basedir => no value => no value output_buffering => 0 => 0 output_handler => no value => no value post_max_size => 8M => 8M precision => 14 => 14 realpath_cache_size => 16K => 16K realpath_cache_ttl => 120 => 120 register_argc_argv => On => On report_memleaks => On => On report_zend_debug => Off => Off request_order => GP => GP sendmail_from => no value => no value sendmail_path => /usr/sbin/sendmail -t -i => /usr/sbin/sendmail -t -i serialize_precision => 17 => 17 short_open_tag => Off => Off SMTP => localhost => localhost smtp_port => 25 => 25 sql.safe_mode => Off => Off track_errors => Off => Off unserialize_callback_func => no value => no value upload_max_filesize => 2M => 2M upload_tmp_dir => no value => no value user_dir => no value => no value user_ini.cache_ttl => 300 => 300 user_ini.filename => .user.ini => .user.ini variables_order => GPCS => GPCS xmlrpc_error_number => 0 => 0 xmlrpc_errors => Off => Off zend.detect_unicode => On => On zend.enable_gc => On => On zend.multibyte => Off => Off zend.script_encoding => no value => no value ctype ctype functions => enabled date date/time support => enabled "Olson" Timezone Database Version => 2014.8 Timezone Database => internal Default timezone => UTC Directive => Local Value => Master Value date.default_latitude => 31.7667 => 31.7667 date.default_longitude => 35.2333 => 35.2333 date.sunrise_zenith => 90.583333 => 90.583333 date.sunset_zenith => 90.583333 => 90.583333 date.timezone => no value => no value dom DOM/XML => enabled DOM/XML API Version => 20031129 libxml Version => 2.7.6 HTML Support => enabled XPath Support => enabled XPointer Support => enabled Schema Support => enabled RelaxNG Support => enabled ereg Regex Library => Bundled library enabled exif EXIF Support => enabled EXIF Version => 1.4 $Id: 05041c5f0094cb46d9b516bd624d593b90cc38f9 $ Supported EXIF Version => 0220 Supported filetypes => JPEG,TIFF Directive => Local Value => Master Value exif.decode_jis_intel => JIS => JIS exif.decode_jis_motorola => JIS => JIS exif.decode_unicode_intel => UCS-2LE => UCS-2LE exif.decode_unicode_motorola => UCS-2BE => UCS-2BE exif.encode_jis => no value => no value exif.encode_unicode => ISO-8859-15 => ISO-8859-15 fileinfo fileinfo support => enabled version => 1.0.5 filter Input Validation and Filtering => enabled Revision => $Id: ad78b4a085153b8c7f4d6db5dc69df40e969c343 $ Directive => Local Value => Master Value filter.default => unsafe_raw => unsafe_raw filter.default_flags => no value => no value gd GD Support => enabled GD Version => bundled (2.1.0 compatible) FreeType Support => enabled FreeType Linkage => with freetype FreeType Version => 2.3.11 GIF Read Support => enabled GIF Create Support => enabled JPEG Support => enabled libJPEG Version => 6b PNG Support => enabled libPNG Version => 1.2.49 WBMP Support => enabled XBM Support => enabled Directive => Local Value => Master Value gd.jpeg_ignore_warning => 0 => 0 hash hash support => enabled Hashing Engines => md2 md4 md5 sha1 sha224 sha256 sha384 sha512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru snefru256 gost adler32 crc32 crc32b fnv132 fnv164 joaat haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5 iconv iconv support => enabled iconv implementation => glibc iconv library version => 2.12 Directive => Local Value => Master Value iconv.input_encoding => ISO-8859-1 => ISO-8859-1 iconv.internal_encoding => ISO-8859-1 => ISO-8859-1 iconv.output_encoding => ISO-8859-1 => ISO-8859-1 json json support => enabled json version => 1.2.1 libxml libXML support => active libXML Compiled Version => 2.7.6 libXML Loaded Version => 20706 libXML streams => enabled mbstring Multibyte Support => enabled Multibyte string engine => libmbfl HTTP input encoding translation => disabled libmbfl version => 1.3.2 mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1. Multibyte (japanese) regex support => enabled Multibyte regex (oniguruma) backtrack check => On Multibyte regex (oniguruma) version => 4.7.1 Directive => Local Value => Master Value mbstring.detect_order => no value => no value mbstring.encoding_translation => Off => Off mbstring.func_overload => 0 => 0 mbstring.http_input => pass => pass mbstring.http_output => pass => pass mbstring.http_output_conv_mimetypes => ^(text/|application/xhtml\+xml) => ^(text/|application/xhtml\+xml) mbstring.internal_encoding => no value => no value mbstring.language => neutral => neutral mbstring.strict_detection => Off => Off mbstring.substitute_character => no value => no value mcrypt mcrypt support => enabled mcrypt_filter support => enabled Version => 2.5.8 Api No => 20021217 Supported ciphers => cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes Supported modes => cbc cfb ctr ecb ncfb nofb ofb stream Directive => Local Value => Master Value mcrypt.algorithms_dir => no value => no value mcrypt.modes_dir => no value => no value mysql MySQL Support => enabled Active Persistent Links => 0 Active Links => 0 Client API version => 5.1.73 MYSQL_MODULE_TYPE => external MYSQL_SOCKET => /tmp/mysql.sock MYSQL_INCLUDE => -I/usr/local/mysql/include MYSQL_LIBS => -L/usr/local/mysql/lib -lmysqlclient Directive => Local Value => Master Value mysql.allow_local_infile => On => On mysql.allow_persistent => On => On mysql.connect_timeout => 60 => 60 mysql.default_host => no value => no value mysql.default_password => no value => no value mysql.default_port => no value => no value mysql.default_socket => /tmp/mysql.sock => /tmp/mysql.sock mysql.default_user => no value => no value mysql.max_links => Unlimited => Unlimited mysql.max_persistent => Unlimited => Unlimited mysql.trace_mode => Off => Off openssl OpenSSL support => enabled OpenSSL Library Version => OpenSSL 1.0.1e-fips 11 Feb 2013 OpenSSL Header Version => OpenSSL 1.0.1e-fips 11 Feb 2013 pcre PCRE (Perl Compatible Regular Expressions) Support => enabled PCRE Library Version => 8.37 2015-04-28 Directive => Local Value => Master Value pcre.backtrack_limit => 1000000 => 1000000 pcre.recursion_limit => 100000 => 100000 PDO PDO support => enabled PDO drivers => sqlite pdo_sqlite PDO Driver for SQLite 3.x => enabled SQLite Library => 3.8.10.2 Phar Phar: PHP Archive support => enabled Phar EXT version => 2.0.1 Phar API version => 1.1.1 SVN revision => $Id: ba734629367f9671b25202408d13914fa63d8396 $ Phar-based phar archives => enabled Tar-based phar archives => enabled ZIP-based phar archives => enabled gzip compression => enabled bzip2 compression => enabled Native OpenSSL support => enabled Phar based on pear/PHP_Archive, original concept by Davey Shafik. Phar fully realized by Gregory Beaver and Marcus Boerger. Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle. Directive => Local Value => Master Value phar.cache_list => no value => no value phar.readonly => On => On phar.require_hash => On => On posix Revision => $Id: 1dfa9997ed76804e53c91e0ce862f3707617b6ed $ Reflection Reflection => enabled Version => $Id: f6367cdb4e3f392af4a6d441a6641de87c2e50c4 $ session Session Support => enabled Registered save handlers => files user Registered serializer handlers => php php_binary Directive => Local Value => Master Value session.auto_start => Off => Off session.cache_expire => 180 => 180 session.cache_limiter => nocache => nocache session.cookie_domain => no value => no value session.cookie_httponly => Off => Off session.cookie_lifetime => 0 => 0 session.cookie_path => / => / session.cookie_secure => Off => Off session.entropy_file => /dev/urandom => /dev/urandom session.entropy_length => 32 => 32 session.gc_divisor => 1000 => 1000 session.gc_maxlifetime => 1440 => 1440 session.gc_probability => 1 => 1 session.hash_bits_per_character => 5 => 5 session.hash_function => 0 => 0 session.name => PHPSESSID => PHPSESSID session.referer_check => no value => no value session.save_handler => files => files session.save_path => no value => no value session.serialize_handler => php => php session.upload_progress.cleanup => On => On session.upload_progress.enabled => On => On session.upload_progress.freq => 1% => 1% session.upload_progress.min_freq => 1 => 1 session.upload_progress.name => PHP_SESSION_UPLOAD_PROGRESS => PHP_SESSION_UPLOAD_PROGRESS session.upload_progress.prefix => upload_progress_ => upload_progress_ session.use_cookies => On => On session.use_only_cookies => On => On session.use_trans_sid => 0 => 0 SimpleXML Simplexml support => enabled Revision => $Id: 16070fc92ad6f69cebb2d52ad3f02794f833ce39 $ Schema support => enabled soap Soap Client => enabled Soap Server => enabled Directive => Local Value => Master Value soap.wsdl_cache => 1 => 1 soap.wsdl_cache_dir => /tmp => /tmp soap.wsdl_cache_enabled => 1 => 1 soap.wsdl_cache_limit => 5 => 5 soap.wsdl_cache_ttl => 86400 => 86400 sockets Sockets Support => enabled SPL SPL support => enabled Interfaces => Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject Classes => AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, CallbackFilterIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveCallbackFilterIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException sqlite3 SQLite3 support => enabled SQLite3 module version => 0.7 SQLite Library => 3.8.10.2 Directive => Local Value => Master Value sqlite3.extension_dir => no value => no value standard Dynamic Library Support => enabled Path to sendmail => /usr/sbin/sendmail -t -i Directive => Local Value => Master Value assert.active => 1 => 1 assert.bail => 0 => 0 assert.callback => no value => no value assert.quiet_eval => 0 => 0 assert.warning => 1 => 1 auto_detect_line_endings => 0 => 0 default_socket_timeout => 60 => 60 from => no value => no value url_rewriter.tags => a=href,area=href,frame=src,input=src,form=fakeentry => a=href,area=href,frame=src,input=src,form=fakeentry user_agent => no value => no value tokenizer Tokenizer Support => enabled xml XML Support => active XML Namespace Support => active libxml2 Version => 2.7.6 xmlreader XMLReader => enabled xmlwriter XMLWriter => enabled zlib ZLib Support => enabled Stream Wrapper => compress.zlib:// Stream Filter => zlib.inflate, zlib.deflate Compiled Version => 1.2.3 Linked Version => 1.2.3 Directive => Local Value => Master Value zlib.output_compression => Off => Off zlib.output_compression_level => -1 => -1 zlib.output_handler => no value => no value Additional Modules Module Name Environment Variable => Value HOSTNAME => iZ28g7mpz93Z TERM => xterm SHELL => /bin/bash HISTSIZE => 1000 SSH_CLIENT => 182.98.132.9 63157 22 SSH_TTY => /dev/pts/1 USER => root LS_COLORS => rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36: MAIL => /var/spool/mail/root PATH => /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/mysql/bin:/usr/local/apache/bin:/root/bin PWD => /root LANG => en_US.UTF-8 HISTCONTROL => ignoredups SHLVL => 1 HOME => /root LOGNAME => root CVS_RSH => ssh SSH_CONNECTION => 182.98.132.9 63157 115.28.167.185 22 LESSOPEN => |/usr/bin/lesspipe.sh %s G_BROKEN_FILENAMES => 1 _ => /usr/local/php/bin/php PHP Variables Variable => Value _SERVER["HOSTNAME"] => iZ28g7mpz93Z _SERVER["TERM"] => xterm _SERVER["SHELL"] => /bin/bash _SERVER["HISTSIZE"] => 1000 _SERVER["SSH_CLIENT"] => 182.98.132.9 63157 22 _SERVER["SSH_TTY"] => /dev/pts/1 _SERVER["USER"] => root _SERVER["LS_COLORS"] => rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36: _SERVER["MAIL"] => /var/spool/mail/root _SERVER["PATH"] => /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/mysql/bin:/usr/local/apache/bin:/root/bin _SERVER["PWD"] => /root _SERVER["LANG"] => en_US.UTF-8 _SERVER["HISTCONTROL"] => ignoredups _SERVER["SHLVL"] => 1 _SERVER["HOME"] => /root _SERVER["LOGNAME"] => root _SERVER["CVS_RSH"] => ssh _SERVER["SSH_CONNECTION"] => 182.98.132.9 63157 115.28.167.185 22 _SERVER["LESSOPEN"] => |/usr/bin/lesspipe.sh %s _SERVER["G_BROKEN_FILENAMES"] => 1 _SERVER["_"] => /usr/local/php/bin/php _SERVER["PHP_SELF"] => _SERVER["SCRIPT_NAME"] => _SERVER["SCRIPT_FILENAME"] => _SERVER["PATH_TRANSLATED"] => _SERVER["DOCUMENT_ROOT"] => _SERVER["REQUEST_TIME_FLOAT"] => 1459321657.1508 _SERVER["REQUEST_TIME"] => 1459321657 _SERVER["argv"] => Array ( ) _SERVER["argc"] => 0 PHP License This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.
apach结合php(解析PHP):
Apache主配置文件为:/usr/local/apache/conf/httpd.conf
显示It works!,则lamp搭建成功
/usr/local/apache/htdocs/#apach的网页目录
apach目前还不支持解析PHP
vim /usr/local/apache/conf/httpd.conf
AddType application/x-httpd-php .php
修改配置文件就要重新加载它
查看PHP版本信息