centos6.5 yum安装php5.5,mysql5.5.46 ,aphche 2.2.15
1 是为了更好的安装php,mysql等yum源用的
安装EPEL源:
(64位系统) rpm -ivh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
(32位系统) rpm -ivh http://download.Fedora.RedHat.com/pub/epel/6/i386/epel-release-6-8.noarch.rpm
安装REMI源:
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
开启REMI,编辑 /etc/yum.repos.d/remi.repo
vi /etc/yum.repos.d/remi.repo
修改 [remi] 的enable=1
esc
:wq
2 yum 安装 php5.5,mysql5.5.46 ,aphche 2.2.15
yum -y install httpd php55.x86_64 php55-php.x86_64 php55-php-cli.x86_64 php55-php-common.x86_64 php55-php-devel.x86_64 php55-php-gd.x86_64 php55-php-mbstring.x86_64 php55-php-mcrypt.x86_64 php55-php-mysqlnd.x86_64 php55-php-opcache.x86_64 php55-php-pdo.x86_64 php55-php-pear.noarch php55-php-pecl-igbinary.x86_64 php55-php-pecl-jsonc.x86_64 php55-php-pecl-jsonc-devel.x86_64 php55-php-pecl-lua.x86_64 php55-php-pecl-memcached.x86_64 php55-php-pecl-msgpack.x86_64 php55-php-pecl-mysqlnd-qc.x86_64 php55-php-pecl-yac.x86_64 php55-php-pecl-yaf.x86_64 php55-php-pecl-zip.x86_64 php55-php-process.x86_64 php55-php-snmp.x86_64 php55-php-soap.x86_64 php55-php-xml.x86_64 php55-php-xmlrpc.x86_64 php55-runtime.x86_64 php55-build.x86_64 php55-mysqlnd-qc-panel.noarch php55-php-bcmath.x86_64 php55-php-channel-horde.noarch php55-php-dba.x86_64 php55-php-enchant.x86_64 php55-php-fpm.x86_64 php55-php-gmp.x86_64 php55-php-horde-horde-lz4.x86_64 php55-php-imap.x86_64 php55-php-interbase.x86_64 php55-php-intl.x86_64 php55-php-ioncube-loader.x86_64 php55-php-ldap.x86_64 php55-php-libvirt.x86_64 php55-php-libvirt-doc.noarch php55-php-litespeed.x86_64 php55-php-magickwand.x86_64 php55-php-mssql.x86_64 php55-php-odbc.x86_64 php55-php-pecl-amqp.x86_64 php55-php-pecl-apcu.x86_64 php55-php-pecl-apcu-devel.x86_64 php55-php-pecl-ares.x86_64 php55-php-pecl-bbcode.x86_64 php55-php-pecl-binpack.x86_64 php55-php-pecl-bitset.x86_64 php55-php-pecl-blenc.x86_64 php55-php-pecl-cairo.x86_64 php55-php-pecl-cairo-devel.x86_64 php55-php-pecl-chdb.x86_64 php55-php-pecl-couchbase.x86_64 php55-php-pecl-crypto.x86_64 php55-php-pecl-dbus.x86_64 php55-php-pecl-dio.x86_64 php55-php-pecl-doublemetaphone.x86_64 php55-php-pecl-eio.x86_64 php55-php-pecl-ev.x86_64 php55-php-pecl-event.x86_64 php55-php-pecl-fann.x86_64 php55-php-pecl-gearman.x86_64 php55-php-pecl-geoip.x86_64 php55-php-pecl-gnupg.x86_64 php55-php-pecl-graphdat.x86_64 php55-php-pecl-haru.x86_64 php55-php-pecl-hidef.x86_64 php55-php-pecl-hrtime.x86_64 php55-php-pecl-igbinary-devel.x86_64 php55-php-pecl-imagick-devel.x86_64 php55-php-pecl-inclued.x86_64 php55-php-pecl-inotify.x86_64 php55-php-pecl-ircclient.x86_64 php55-php-pecl-jsond.x86_64 php55-php-pecl-jsond-devel.x86_64 php55-php-pecl-judy.x86_64 php55-php-pecl-judy-devel.x86_64 php55-php-pecl-krb5.x86_64 php55-php-pecl-krb5-devel.x86_64 php55-php-pecl-leveldb.x86_64 php55-php-pecl-libsodium.x86_64 php55-php-pecl-lzf.x86_64 php55-php-pecl-mailparse.x86_64 php55-php-pecl-memcache.x86_64 php55-php-pecl-memprof.x86_64 php55-php-pecl-mongo.x86_64 php55-php-pecl-msgpack-devel.x86_64 php55-php-pecl-mysqlnd-ms.x86_64 php55-php-pecl-mysqlnd-ms-devel.x86_64 php55-php-pecl-mysqlnd-qc-devel.x86_64 php55-php-pecl-ncurses.x86_64 php55-php-pecl-newt.x86_64 php55-php-pecl-oauth.x86_64 php55-php-pecl-oci8.x86_64 php55-php-pecl-parsekit.x86_64 php55-php-pecl-pcsc.x86_64 php55-php-pecl-pcsc-devel.x86_64 php55-php-pecl-pdflib.x86_64 php55-php-pecl-propro.x86_64 php55-php-pecl-propro-devel.x86_64 php55-php-pecl-protocolbuffers.x86_64 php55-php-pecl-quickhash.x86_64 php55-php-pecl-radius.x86_64 php55-php-pecl-raphf.x86_64 php55-php-pecl-raphf-devel.x86_64 php55-php-pecl-rar.x86_64 php55-php-pecl-redis.x86_64 php55-php-pecl-riak.x86_64 php55-php-pecl-rrd.x86_64 php55-php-pecl-runkit.x86_64 php55-php-pecl-scream.x86_64 php55-php-pecl-scrypt.x86_64 php55-php-pecl-sdl.x86_64 php55-php-pecl-selinux.x86_64 php55-php-pecl-solr.x86_64 php55-php-pecl-sphinx.x86_64 php55-php-pecl-spl-types.x86_64 php55-php-pecl-ssdeep.x86_64 php55-php-pecl-ssh2.x86_64 php55-php-pecl-stats.x86_64 php55-php-pecl-stomp.x86_64 php55-php-pecl-strict.x86_64 php55-php-pecl-swoole.x86_64 php55-php-pecl-sync.x86_64 php55-php-pecl-termbox.x86_64 php55-php-pecl-uopz.x86_64 php55-php-pecl-uploadprogress.x86_64 php55-php-pecl-uri-template.x86_64 php55-php-pecl-uuid.x86_64 php55-php-pecl-weakref.x86_64 php55-php-pecl-xattr.x86_64 php55-php-pecl-xdebug.x86_64 php55-php-pgsql.x86_64 mysql-bench.x86_64 mysql-devel.x86_64 mysql-libs.x86_64 mysql-server.x86_64
有时候会遇到无法安装,是由于网络问题引起的,从新yum就行
3 配置apache配置文件httpd.conf
find -name httpd.conf
有时候在启动apahce会有一个警告提示,修改ServerName localhost:80就可以了
外网无法访问的时候就修改需要的AllowOverride 设置为ALL
4 设置apache,mysql启动
service httpd start(start|stop|restart|reload)
service mysqld start(start|stop|restart|reload)
设置自启动
chkconfig httpd on
chkconfig mysqld on
5 设置mysql
mysql 设置密码
方法1 mysqladmin -u root password 'XXXX'
方法2 进入mysql ,然后use mysql ,然后 update user set password=password('XXXX') where user='root';
mysql外网访问
首先进入mysql,然后use mysql;
接下来create user zx_root IDENTIFIED by 'XXXXX'; //zx_root 你的帐号名,XXXXX密码 dentified by 会将纯文本密码加密作为散列值存储
然后GRANT ALL PRIVILEGES ON *.* TO 'zx_root'@'%' IDENTIFIED BY 'XXXXX' WITH GRANT OPTION;
最后flush privileges;
完成收工
6 php时间
修改php.ini
date.timezone = PRC