云服务器配置

 云服务:Ubuntu 18.04 64位 阿里云

sudo apt-get update

配置中文

sudo apt-get install -y language-pack-en-base

locale-gen en_US.UTF-8

sudo apt-get install software-properties-common

sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php

sudo apt-get update

按需配置

sudo apt-get -y install php7.1

sudo apt-get -y install php7.1-mysql

sudo apt-get install php7.1-fpm

apt-get install php7.1-curl php7.1-xml php7.1-mcrypt php7.1-json php7.1-gd php7.1-mbstring

sudo apt-get -y install nginx 配置完成并正确可以直接打开域名查看

sudo apt-get -y install mysql-server-5.8

报错

E: Unable to locate package mysql-server-5.8
E: Couldn't find any package by glob 'mysql-server-5.8'
E: Couldn't find any package by regex 'mysql-server-5.8'

使用sudo apt-get -y install mysql-server

配置nginx如下修改:

sudo vim /etc/php/7.1/fpm/php.ini    // 将cgi.fix_pathinfo=1这一行去掉注释,将1改为0

sudo vim /etc/php/7.1/fpm/pool.d/www.conf // 配置这个 listen = /var/run/php7.1-fpm.sock

sudo service php7.1-fpm restart

sudo vim /etc/nginx/sites-available/default

listen 80 default_server;        

listen [::]:80 default_server ipv6only=on;

root /var/www/laravel-ubuntu/public;        

index index.php index.html index.htm;

# Make site accessible from http://localhost/

server_name localhost;

location / {

try_files $uri $uri/ /index.php?$query_string;

}

location ~ \.php$ {                

try_files $uri /index.php =404;              

fastcgi_split_path_info ^(.+\.php)(/.+)$;    

fastcgi_pass unix:/var/run/php7.1-fpm.sock;          

fastcgi_index index.php;          

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;      

 include fastcgi_params;  

}

如下报错:
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
阿里服务器配置Python的步骤如下: 1. 首先,在阿里控制台上创建一个服务器(ECS实例)并获取访问凭证,包括主机IP地址、用户名和密码。可以参考阿里官方文档中的步骤来完成这一步骤。\[2\] 2. 在创建的服务器上安装Docker。具体的安装步骤可以参考阿里官方文档中的指引。\[2\] 3. 在本地开发环境准备Docker镜像。可以根据自己的需求选择合适的Python镜像,并在本地进行准备。\[2\] 4. 登录到阿里服务器,可以使用SSH工具连接到服务器。然后,使用命令行界面进入服务器的操作系统。 5. 检查服务器上的Python版本。可以使用命令`python --version`来查看Python的版本信息。如果只输入`python`命令,则可能显示的是服务器自带的Python版本,比如Python 2.7。\[3\] 6. 如果需要配置特定版本的Python,可以根据自己的需求进行安装和配置。可以使用包管理工具(如pip)来安装所需的Python版本和相关的库。 总结起来,配置阿里服务器的Python环境包括创建服务器、安装Docker、准备本地开发环境的Docker镜像,并根据需要安装和配置特定版本的Python。\[2\]\[3\] #### 引用[.reference_title] - *1* [上python:【一】添加服务器并搭建环境](https://blog.csdn.net/qq_42059060/article/details/111151518)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [如何将本地python项目部署到阿里服务器上(完整版)](https://blog.csdn.net/qq_44997147/article/details/131163953)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [阿里服务器安装配置 python(CentOS 7.6)](https://blog.csdn.net/m0_47744782/article/details/113925494)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值