1 centos7 Nginx1.14+php7.0+mysql5.7 (LNMP)安装
nginxrpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpmyum install epel-releasephprpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpmyum install php70w-fpm php70w-cli php70w-gdphp70w-mysql php70w-pear php70w-xml php70w-mbstring php70w-pdo php70w-json php70w-pecl-apcu php70w-pecl-apcu-develmysqlrpm -Uvh http://repo.mysql.com/mysql57-community-release-el7-7.noarch.rpmyum install mysql-server mysql-devel mysql外部登录grep ‘temporary password‘ /var/log/mysqld.logmysql_secure_installationgrant all privileges on *.* to 创建的用户名 @"%" identified by "密码";flush privileges; 配置/etc/php-fpm/www.config/etc/nginx/conf.d default.confserver {listen 80;fastcgi_buffers 16 16k;fastcgi_buffer_size 32k;server_name test1.loc www.test1.loc;error_log /var/log/default_error.log;root /usr/share/nginx/html;index index.php index.html index.htm;location ~ \.php$ {#fastcgi_pass unix:/var/run/php-fpm.sock;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;include fastcgi_params;}}systemctl restart nginx.servicesystemctl enablenginx.servicesystemctl enable php-fpm.servicesystemctl start php-fpm.serviceservice mysqld start service mysqld stop
说说配置lnmp遇到的坑 测试时一定要使用<?php?>这样的PHP标记 fastcgi默认是不能解析<??>这样的PHP代码标记的 更别说 <% %>这样以及其他的
为了这个问题苦恼了两天,国内外的论坛·博客翻烂了没找到解决办法
这就是代码规范的 重要性
2 centos7 +PHP7.2+Apache2.4+mysql (lamp)简单配置
mysqlrpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*yum -y install epel-release 安装releaseyum -y install mariadb-server mariadb 安装mysqlsystemctl start mariadb.service 开启服务systemctl enable mariadb.service 添加到开机启动mysql_secure_installation mysql重置命令Apacheyum -y install httpdsystemctl start httpd.servicesystemctl enable httpd.servicephprpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpmyum -y install yum-utils yum-config-manager utility7.0yum-config-manager --enable remi-php70yum -y install php php-opcache7.1yum-config-manager --enable remi-php71yum -y install php php-opcache7.2yum-config-manager --enable remi-php72yum -y install php php-opcache测试ystemctl restart httpd.servicevi /var/www/html/info.php<?phpphpinfo();安装PHP模块yum -y install php-mysqlnd php-pdoyum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-soap curl curl-develsystemctl restart httpd.service
3Linux操作系统下composer安装 前提 安装PHP并且启动PHP服务
curl -sS https://getcomposer.org/installer | phpmv composer.phar /usr/local/bin/composerchmod -R 777 /usr/local/bin/composer
4 centos 下Python2.7 升级到Python3.7
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz下载压缩包tar -zxvf Python-3.7.0.tgz解压cd Python-3.7.0/进入目录./configure对安装软件进行配置 如果出错 先安装GCC yum install make gcc gcc-c++ ./configuremake & make install编辑以及编译安装顺带一提安装模块提示pip: command not found以下如何解决wget https://bootstrap.pypa.io/get-pip.pypython get-pip.pypython -v