欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

阿里云-workerman 服务器环境配置

程序员文章站 2022-04-16 07:50:01
1、购买阿里云 centos 服务器 2、下载 Linux一键安装web环境 ,并copy到服务器 3、执行一键安装包(./install.sh),会自动清理之前一键安装包安装过的环境。 4、根据需要选择相应软件版本 5、查看密码: 标准版:cat /alidata/account.log 专业版: ......

1、购买阿里云 centos 服务器

2、下载 linux一键安装web环境 ,并copy到服务器

3、执行一键安装包(./install.sh),会自动清理之前一键安装包安装过的环境。

4、根据需要选择相应软件版本

5、查看密码:

标准版:cat /alidata/account.log

专业版:cat /root/sh-1.5.4/account.log

注意:有可能不在这里,而是在下载目录里

6、安装 phpwind 和 phpmyadmin

直接在浏览器中输入您的域名或者 ip,如果是第一次访问 phpwind,则会自动跳转到安装页面。

7、六、 环境目录及相关操作命令

网站目录:/alidata/www 服务器软件目录:/alidata/servermysql 目录 /alidata/server/mysql php 目录/alidata/server/php

tomcat 目录/alidata/server/tomcat7

选择了 nginx 那么会有一个 nginx 目录在 /alidata/server/nginx/

nginx 配置文件在/alidata/server/nginx/conf

nginx 虚拟主机添加 你可以修改/alidata/server/nginx/conf/vhosts/phpwind.conf

选择了 apache 那么会有一个 httpd 目录在 /alidata/server/httpd

apache 配置文件在/alidata/server/httpd/conf

apache 虚拟主机添加 你可以修改/alidata/server/httpd/conf/vhosts/phpwind.conf

各个服务操作命令汇总:

nginx: 

/etc/init.d/nginx start/stop/restart/reload) 

apache: 

/etc/init.d/httpd start/stop/restart/… 

mysql: 

/etc/init.d/mysqld start/stop/restart/… 

php-fpm:/etc/init.d/php-fpm start/stop/restart/… 

tomcat: 

/etc/init.d/tomcat7 start/stop/restart/… 

ftp: 

/etc/init.d/vsftpd start/stop/restart/… 比如启动 nginx: 

/etc/init.d/nginx start

  

8、 安装 workerman 环境

http://www.workerman.net/install 

  

1、在命令中运行 curl -ss  | php 检测本地环境是否满足workerman。

他这个软件包没有 pcntl扩展,需要自己安装一下,这个扩展安装头疼了我一天。不过今天突然就开窍了,其实也是很简单,只不过之前算牛角尖了,一直出错。

首先就是需要进入到php 源码包的 pcntl目录,

[root@iz25pkurrazz etc]# cd /mnt/sh-1.4.5/php-5.5.7/ext/pcntl/

  

然后

/alidata/server/php-5.5.7/bin/phpize && ./configure && make install 一下,

注意:如果报错:configure: error: cannot find php-config. please use --with-php-config=path

,那么就需要找到 php-config , find / -name php-config,

找到 /alidata/server/php-5.5.7/bin/php-config,

所以 应该是:

/alidata/server/php-5.5.7/bin/phpize && ./configure --with-php-config=/alidata/server/php-5.5.7/bin/php-config  && make install

  

再把 扩展加到php.ini 中,就行了,之前的错误就是因为写错了地方,这个软件包的php.ini 在/alidata/server/php/etc/php.ini

,所以我们也要写到这里

[root@iz25pkurrazz pcntl]# echo "extension=pcntl.so" >> /alidata/server/php/etc/php.ini 

  

如果是 php-5.5.7,就是:

echo "extension=pcntl.so" >> /alidata/server/php-5.5.7/etc/php.ini

  

,完事儿!!!

对了,记得重启下php 和服务器,apache 还是 nginx

重启

nginx [root@iz25pkurrazz pcntl]# /etc/init.d/nginx restart

  

重启php [root@iz25pkurrazz pcntl]# /etc/init.d/php-fpm restart

在 用 php -m ,发现 pdo 和 pcntl扩展都有了,再用 curl -ss  | php检测一下也可以了。

9、打开phpmyadmin ,创建数据库,导入数据库文件。

10、修改项目数据库用户名,密码。

11、添加修改 xx.conf 虚拟主机文件

12、开启 phpinfo,需要在php.ini 中关闭 ;short_open_tag = off,重启

php高级开发工程师简历打造,祝你金三银四跳槽加薪

更多学习内容请访问:

八重樱:腾讯t3-t4标准精品php架构师教程目录大全,只要你看完保证薪资上升一个台阶(持续更新)​zhuanlan.zhihu.com阿里云-workerman 服务器环境配置

以上内容希望帮助到大家,很多phper在进阶的时候总会遇到一些问题和瓶颈,业务代码写多了没有方向感,不知道该从那里入手去提升,对此我整理了一些资料,包括但不限于:分布式架构、高可扩展、高性能、高并发、服务器性能调优、tp6,laravel,yii2,redis,swoole、swoft、kafka、mysql优化、shell脚本、docker、微服务、nginx等多个知识点高级进阶干货需要的可以免费分享给大家,需要的可以加入我的官方群点击此处