安装LNMP

第一次安装

  1. yum update
  2. CentOS7下 Nginx1.13.5 + PHP7.1.10 + MySQL5.7.19 源码编译安装
  3. 安装mySQL时,mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directoryinnobackupex: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory 解决办法中使用了yum install numactl -y安装了依赖包,不过其他问题来了。

搞坏了一个东西,重装吧。而且这篇排版啥的pre标签文字过长都隐藏了不好重新找一个yum安装吧。

第二次安装

  1. nginx安装后用 nginx 可以直接启动
nginx
nginx -s stop|reload 也可 service nginx start 还可以直接 /usr/sbin/nginx
  1. mysql
[root@]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
[root@]# service mysqld status

提醒重定向 systemctl 但是也是可以用 service mysqld start/stop 启停的,service mysqld status 查看状态。

重置密码的时候,提醒Your password does not satisfy the current policy requirements (mysql文档规定,密码必须包括大小写字母数字加特殊符号>8位),那么复杂以后肯定会忘记的(暴雪账号忘过太多次了),基于 ERROR 1819 (HY000): Your password does not satisfy the current policy requirementsmysql> set global validate_password_policy=0; 设置参数为0,则只判断长度。

  1. php也是傻瓜式安装,需启动php-fpm。修改完配置后也需要重启php-fpm
service php-fpm start|stop

访问php页面会直接下载,需要配置nginx,我最后的配置是

    server {
location / {
index index.html index.htm index.php;
} location ~ .php$ {
# root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

可惜没有用户权限管理。

Laravel

  1. 安装 Composer

curl -sS https://getcomposer.org/installer | php 下载得到 composer.phar

参考 Composer简介mv composer.phar /usr/local/bin/composer放到执行目录,方可直接composer命令直接调用。

  1. 安装 Laravel

ln -s /usr/share/nginx/html/vendor/bin/laravel /usr/local/bin/laravel 给执行目录下放个链接

laravel new messages

或者直接 /usr/share/nginx/html/vendor/bin/laravel new messages


The stream or file "/.../html/messages/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied

storage 目录需要权限 chmod -R 777 storage

开发

navicat ssl 远程连接 mysql

新增数据库用户及密码:CREATE USER 'cowpea'@'%' IDENTIFIED BY 'Cowpea1!'

使用

Laravel 使用数据库时 Connections using insecure transport are prohibited while --require_secure_transport=ON.,mysql ssl问题,错误出来的那一刹都已经预料到,加了ssl就不能回头了啊,继续搞。

        'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
//for ssl.... :(
'sslmode' => env('DB_SSLMODE', 'prefer'),
'options' => array(
PDO::MYSQL_ATTR_SSL_KEY => '/var/lib/mysql/client-key.pem',
PDO::MYSQL_ATTR_SSL_CERT => '/var/lib/mysql/client-cert.pem',
PDO::MYSQL_ATTR_SSL_CA => '/var/lib/mysql/ca.pem',
),
],

注册登录错误

访问错误:

访问 messages/public/register 时,出错404,nginx配置。

老板,来一份配置,少放点辣子 Laravel 在 Nginx 中的参考配置两份

根目录直接放public目录吧,好开发。

注册错误:

试着注册一个账号,

SQLSTATE[HY000] [2026] SSL connection error: Unable to get private key (SQL: select count(*) as aggregate from `users` where `email` = ss@qq.com)

用了一个多小时,

还是没有解决,

加了\PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false也没用,我的没有这个 Undefined class constant 'MYSQL_ATTR_SSL_VERIFY_SERVER_CERT'

终于发现了救命稻草:

PHP application cannot connect to MySQL over SSL

After a few bug reports and complaints a new PDO::MySQL attribute was added in php-7.0.18, php-7.1.4 with commit 247ce052cd0fc7d0d8ea1a0e7ea2075e9601766a but not documented in the official documentation.

If after adding this parameter you get an error message

PHP message: Error: Undefined class constant 'MYSQL_ATTR_SSL_VERIFY_SERVER_CERT'

then your PHP version does not support that parameter and you need to upgrade.

卧槽,还得升级到7.1.4我是7.1.14,我弄个锤子的SSL啊,毁我青春。赶紧去掉/etc/my.cnf的ssl配置。

centos7安装LNMP与Laravel遇到的一些小问题的更多相关文章

  1. 腾讯云CentOS7安装LNMP+wordpress

    许多云主机都有学生优惠,于是我趁着现在大一买了个腾讯1元云主机+免费cn域名(高中生的话就别想了).鉴于我只知道用服务器安装博客,别的用途不了解,所以我就去安装wordpress. 而由于我看的教程有 ...

  2. centos7安装Lnmp(Linux+Nginx+MySql+Php+phpMyAdmin+Apache)

    centos7安装Lnmp(Linux+Nginx+MySql+Php)及Apache   Nginx是俄罗斯人编写的十分轻量级的HTTP服务器,Nginx是一个高性能的HTTP和反向代理服务器,Ng ...

  3. Centos7 安装lnmp

    Centos7 安装lnmp 1.下载 wget http://soft.vpser.net/lnmp/lnmp1.5-full.tar.gz 2.解压 tar -zvxf lnmp1.5-full. ...

  4. CentOS7 下安装 Lnmp 架设 Laravel

    最近在hostos上买了个香港的 vps, 装的 centos7, 在架设了 pptp vpn, 效果还行,就想顺便架设个 laravel 看看.下面是架设的过程.准备工作 更新 yum 源,自带的源 ...

  5. CentOS7 安装LNMP(Linux+Nginx+MySQL+PHP)

    由于工作须要,须要学习php,本来想安装lamp的可是考虑到如今nginxserver有良好的性能且应用广泛. 这里我决定搭建Linux(CentOS7+Nginx+MySQL+PHP)下的webse ...

  6. Centos7安装lnmp环境

    系统版本:centos7 64位 PHP版本:PHP 7.0.21 Nginx版本:1.8.1 MySQL版本:5.5.17 注:1.所有安装都必须放在 /usr/local/src文件夹下 2.添加 ...

  7. centos7 安装lnmp环境

    准备工作 一.配置防火墙 vim /etc/sysconfig/iptables 开启80端口.3306.22端口 -A INPUT -m state --state NEW -m tcp -p tc ...

  8. CentOS 7 安装phpredis和redis(接上一篇centos7安装lnmp)

    一.安装扩展phpredis 1.PHP7 安装redis 扩展phpredis cd /root/software wget https://github.com/edtechd/phpredis/ ...

  9. centos7 安装LNMP(php7)之php7.0 yum安装

    http://www.jianshu.com/p/35f21210668a 安装过程参考上面的网址

随机推荐

  1. c# 一些细节

    1.动态对象和匿名对象偶然看到一个语法,觉得特别方便然后频繁使用,但是没有深究,直到今天忽然发现我潜意思中对它的认知居然是错误的. var data=new { State=1,Message=&qu ...

  2. 【转】基于keras 的神经网络股价预测模型

    from matplotlib.dates import DateFormatter, WeekdayLocator, DayLocator, MONDAY,YEARLY from matplotli ...

  3. Github访问慢解决办法

    为什么慢?github的CDN被某墙屏了. 绕过dns解析,在本地直接绑定host.打开dns查询工具网站http://tool.chinaz.com/dns 查询域名github.global.ss ...

  4. PHP扩展开发:第一个扩展

    在上一篇文章<PHP扩展开发:安装PHP>我们已经将开发PHP扩展的PHP环境安装成功,那么接下来采用最简单直接的方式创建第一个扩展. 我们先假设业务场景,是需要有这么一个扩展,提供一个叫 ...

  5. Vivado约束文件(XDC)的探究(2)

    Vivado约束文件(XDC)的探究(2)

  6. XE5 Android 开发数据访问手机端[转]

    把供手机端调用的web服务完成,接下来实现手机端调用webservices获取数据 1.新建firemonkey mobile application 2.选择blank application 3. ...

  7. sqlserver收缩数据库

    缩数据库文件(如果不压缩,数据库的文件不会减小 企业管理器--右键你要压缩的数据库--所有任务--收缩数据库--收缩文件    --选择日志文件--在收缩方式里选择收缩至XXM,这里会给出一个允许收缩 ...

  8. LeetCode——9. Palindrome Number

    一.题目链接:https://leetcode.com/problems/palindrome-number/ 二.题目大意: 给定一个整数,判断它是否为一个回文数.(例如-12,它就不是一个回文数: ...

  9. Ubuntu 14.10 下HBase错误集

    1 如果机群时间不同步,那么启动子节点RegionServer就会出问题 aused by: org.apache.hadoop.hbase.ipc.RemoteWithExtrasException ...

  10. Flume的Channel

    一.Memory Channel 事件将被存储在内存中(指定大小的队列里) 非常适合那些需要高吞吐量且允许数据丢失的场景下 属性说明: 二.JDBC Channel 事件会被持久化(存储)到可靠的数据 ...