首页 > 作文

腾讯云centos7 从零搭建laravel项目

更新时间:2023-04-07 12:12:56 阅读: 评论:0

网页原创链接:

目标,访问网站出现:

———————–分割线—————————————-

一、laravel homestead 环境安可爱小猫装(腾讯云不支持!)

  试了各种方法,一直报错,最后在旧版腾讯云贴吧里面找到官方解答

内心各种曹尼玛啊啊啊啊啊!

二、测试环境长期关闭 防火墙&linux

//关闭systemctl stop firewalld //关闭开机启动systemctl disable firewalld

//临时关闭linux tenforce 0vim /etc/linux/config把linux=enforcing  改成linux=disabled

三、安装nginx

cd /etc/yum.repos.d/vim nginx.repo

复制下列文本至 nginx.repo (文本来源)

[nginx-stable]name=nginx stable repobaurl=http://nginx.org/packages/centos/$releaver/$baarch/gpgcheck=1enabled=1gpgkey=https://nginx.org/keys/nginx_signing.key[nginx-mainline]name=nginx mainline repobaurl=http://nginx.org/packages/mainline/centos/$releaver/$baarch/gpgcheck=1enabled=0gpgkey=https://nginx.org/keys/nginx_signing.key
yum list | grep nginxyum -y install nginx
nginx -vmkdir /wwwmkdir /www/wwwrootmkdir /www/wwwroot/defaultcd /www/wwwroot/defaultvim index.html

输入至index.html

hellow world!!!
cd /etc/nginx/conf.dvim default.conf

systemctl start nginx
systemctl enable nginx

四、安装php

yum -y install epel-relearpm -ivh https://mirror.webtatic.com/yum/el7/webtatic-relea.rpmyum list | grep php72yum -y install mod_php72w php72w-cli php72w-fpm php72w-common php72w-devel
mkdir /www/wwwroot/learncd /www/wwwroot/learnvim index.php

输入至 index.php

<?phpphpinfo();?>
cd /etc/nginx/conf.d
vim learn.conf

输入下文,

rver {    listen 8080;    rver_name localhost;    root /www/wwwroot/learn;    add_header x-frame-options "sameorigin";    add_header x-xss-protection "1; mode=block";    add_header x-content-type-options "nosniff";    index index.php index.html index.htm;    chart utf-8;    location / {        try_files $uri $uri/ /index.php?$query_string;    }    location = /favicon.ico { access_log off; log_not_found off; }    location = /robots.txt  { access_log off; log_not_found off; }    error_page 404 /index.php;    location ~ \.php$ {        root /www/wwwroot/learn;        fastcgi_split_path_info ^(.+\.php)(/.+)$;        fastcgi_pass 127.0.0.1:9000;        fastcgi_index index.php;        fastcgi_param  script_filename  $document_root$fastcgi_script_name;        include fastcgi_params;    }    location ~ /\.(?!well-known).* {        deny all;    }}
systemctl restart nginxsystemctl start php-fpm
systemctl enable php-fpm

五、安装mysql

cd ~rpm -ivh https://dev.mysql.com/get/mysql80-community-relea-el7-1.noarch.rpmyum list | grep mysqlyum-config-manager --disable mysql80-communityyum-config-manager --enable mysql57-communityyum list | grep mysql//这步安装时间长,请耐心等待,看你的网络状况yum -y install mysql-community-rver mysql-community-clientsystemctl start mysqldsystemctl enable mysqld//设置mysqlt global validate_password_policy=0;t g秦朝灭亡lobal validate_password_mixed_ca_count=0;t global validate_password_number_count=3;t global validate_password_special_char_count=0;t global validate_password_length=3;//复制好密码grep 'temporary password' /var/log/mysqld.logmysql -uroot -p(输入密码)t password for root@localhost = password('root');
//退出mysql
exit;

六、安装compor

cd /tmpcurl -ss /d/file/titlepic/installer | phpmv compor.phar /usr/local/bin/comporcompor -vcompor config -g repo.packagist compor https://packagist.phpcompor.com

七、配置laravel 项目(链接请都点开)

//安装 laravelcompor global require laravel/installer

,path,

下载离线包,

上传文件夹,并解压至 ‘/www/wwwroot/learn2’ 文件夹

cd /www/wwwroot/learn2vim .env

写入下列内容,

app_name=laravelapp_env=localapp_key=ba64:fyg9polrd3bfb/eafyrgnakdfbwtvdobop+imw7u42q=app_debug=理想是石敲出星星之火trueapp_url=http://localhostlog_channel=stackdb_connection=mysqldb_host=127.0.0.1db_port=3306db_databa=laraveldb_urname=rootdb_password=broadcast_driver=logcache_driver=filequeue_connection=syncssion_driver=filession_lifetime=120redis_host=127.0.0.1redis_password=nullredis_port=6379mail_driver=smtpmail_host=smtp.mailtrap.iomail_port=2525mail_urname=nullmail_password=nullmail_encryption=nullaws_access_key_id=aws_cret_access_key=aws_default_region=us-east-1aws_bucket=pusher_app_id=pusher_app_key=pusher_app_cret=pusher_app_cluster=mt1mix_pusher_app_key="${pusher_app_key}"mix_push当兵有工资吗er_app_cluster="${pusher_app_cluster}"

vim /etc/nginx/conf.d/learn2.conf

写入内容,

rver {    listen 8081;    rver_name localhost;    root /www/wwwroot/learn2/public;    add_header x-frame-options "sameorigin";    add_header x-xss-protection "1; mode=block";    add_header x-content-type-options "nosniff";    index index.php index.html index.htm;    chart utf-8;    location / {        try_files $uri $uri/ /index.php?$query_string;    }    location = /favicon.ico { access_log off; log_not_found off; }    location = /robots.txt  { access_log off; log_not_found off; }    error_page 404 /index.php;    location ~ \.php$ {        root /www/wwwroot/learn2/public;        fastcgi_split_path_info ^(.+\.php)(/.+)$;        fastcgi_pass 127.0.0.1:9000;        fastcgi_index index.php;        fastcgi_param  script_filename  $document_root$fastcgi_script_name;        include fastcgi_params;    }    location ~ /\.(?!well-known).* {        deny all;    }}

八、填坑

打开网页 ‘ip:8081’, 各种报错,

先在’www/wwwroot/learn2/public/index.php’ 里添加:

ini_t('display_errors',1);error_reporting(e_all);

错误码0x00000001

cd /www/wwwroot/learn2chmod -r 777 *yum -y install php72w-pdoyum -y install php72w-mysqlsystemctl restart php-fpmphp artisan key:generate

ok!,出现:

本文发布于:2023-04-07 12:12:49,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/zuowen/99da0ad707debce31c25bd9fedb5e841.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

本文word下载地址:腾讯云centos7 从零搭建laravel项目.doc

本文 PDF 下载地址:腾讯云centos7 从零搭建laravel项目.pdf

标签:腾讯   尼玛   报错   文件夹
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图