centos phpinfo?centos6
阿里云上的centos 7.2怎么yum安装php 5.6
因之前通过网易的 centos镜像,将阿里云的 centos升级到最新版了,乘自己的项目尚未开始正式开发,遂将所有的相应环境都升级到最高。
查看 centos版本:
[root@iZ23d~]# cat/etc/centos-release
CentOS Linux release 7.2.1511(Core)
1、删除之前的 php版本:
[root@iZ23d~]# yum remove php* php-common
Loaded plugins: langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
No Match for argument: php-5.4.16
No Match for argument: php-5.4.16.tar.gz
No Match for argument: php-7.0.1RC1
No Match for argument: php-7.0.1RC1.tar.gz
No Match for argument: phpMyAdmin-4.4.0.tar.gz
No Match for argument: php-common
No Packages marked for removal
2、rpm安装 Php7相应的 yum源:
[root@iZ23d~]# rpm-Uvh
Retrieving
warning:/var/tmp/rpm-tmp.LhJKKR: Header V4 RSA/SHA1 Signature, key ID 62e74ca5: NOKEY
Preparing...################################# [100%]
package webtatic-release-7-3.noarch is already installed
3、直接yum安装php7:
[root@iZ23d~]# yum install php70w
Loaded plugins: langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Resolving Dependencies
--> Running transaction check
。。。【省略】
Warning: RPMDB altered outside of yum.
Installing: php70w-common-7.0.0-1.w7.x86_64 1/3
Installing: php70w-cli-7.0.0-1.w7.x86_64 2/3
Installing: php70w-7.0.0-1.w7.x86_64 3/3
Verifying: php70w-7.0.0-1.w7.x86_64 1/3
Verifying: php70w-common-7.0.0-1.w7.x86_64 2/3
Verifying: php70w-cli-7.0.0-1.w7.x86_64 3/3
Installed:
php70w.x86_64 0:7.0.0-1.w7
Dependency Installed:
php70w-cli.x86_64 0:7.0.0-1.w7 php70w-common.x86_64 0:7.0.0-1.w7
Complete!
4、检查 php版本:
[root@iZ23d~]# php-v
PHP 7.0.0(cli)(built: Dec 2 2015 20:42:32)( NTS)
Copyright(c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright(c) 1998-2015 Zend Technologies
[root@iZ23d2e6hoqZ~]#
以上显示安装成功!
5、重启 Apache,查看 phpinfo:
[root@iZ23d~]# systemctl restart httpd.service
检查phpinfo:
PHP Version 7.0.0
SystemLinux iZ23d 3.10.0-229.11.1.el7.x86_64#1 SMP Thu Aug 6 01:06:18 UTC 2015 x86_64
Build DateDec 2 2015 20:43:38
Server APIApache 2.0 Handler
Virtual Directory Supportdisabled
Configuration File(php.ini) Path/etc
Loaded Configuration File/etc/php.ini
Scan this dir for additional.ini files/etc/php.d
Additional.ini files parsed/etc/php.d/bz2.ini,/etc/php.d/calendar.ini,/etc/php.d/ctype.ini,/etc/php.d/curl.ini,/etc/php.d/exif.ini,/etc/php.d/fileinfo.ini,/etc/php.d/ftp.ini,/etc/php.d/gettext.ini,/etc/php.d/gmp.ini,/etc/php.d/iconv.ini,/etc/php.d/json.ini,/etc/php.d/phar.ini,/etc/php.d/shmop.ini,/etc/php.d/simplexml.ini,/etc/php.d/sockets.ini,/etc/php.d/tokenizer.ini,/etc/php.d/xml.ini,/etc/php.d/zip.ini
PHP API20151012
PHP Extension20151012
Zend Extension320151012
Zend Extension BuildAPI320151012,NTS
PHP Extension BuildAPI20151012,NTS
Debug Buildno
Thread Safetydisabled
Zend Signal Handlingdisabled
Zend Memory Managerenabled
Zend Multibyte Supportdisabled
IPv6 Supportenabled
DTrace Supportenabled
Registered PHP Streamshttps, ftps, compress.zlib, php, file, glob, data, http, ftp, compress.bzip2, phar, zip
Registered Stream Socket Transportstcp, udp, unix, udg, ssl, sslv3, sslv2, tls, tlsv1.0, tlsv1.1, tlsv1.2
Registered Stream Filterszlib.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, bzip2.*, convert.iconv.*
This program makes use of the Zend Scripting Language Engine:
Zend Engine v3.0.0, Copyright(c) 1998-2015 Zend Technologies
Configuration
apache2handler
Apache VersionApache/2.4.6(CentOS)
Apache API Version20120211
Server Administratorxxxxxx@xxxxxx.com
Hostname:Portxxxx.xxxxx.xxx:0
User/Groupapache(48)/48
Max RequestsPer Child: 0- Keep Alive: on- Max Per Connection: 100
TimeoutsConnection: 60- Keep-Alive: 15
Virtual ServerYes
Server Root/etc/httpd
Loaded Modulescore mod_so http_core mod_access_compat mod_actions mod_alias mod_allowmethods mod_auth_basic mod_auth_digest mod_authn_anon mod_authn_core mod_authn_dbd mod_authn_dbm mod_authn_file mod_authn_socache mod_authz_core mod_authz_dbd mod_authz_dbm mod_authz_groupfile mod_authz_host mod_authz_owner mod_authz_user mod_autoindex mod_cache mod_cache_disk mod_data mod_dbd mod_deflate mod_dir mod_dumpio mod_echo mod_env mod_expires mod_ext_filter mod_filter mod_headers mod_include mod_info mod_log_config mod_logio mod_mime_magic mod_mime mod_negotiation mod_remoteip mod_reqtimeout mod_rewrite mod_setenvif mod_slotmem_plain mod_slotmem_shm mod_socache_dbm mod_socache_memcache mod_socache_shmcb mod_status mod_substitute mod_suexec mod_unique_id mod_unixd mod_userdir mod_version mod_vhost_alias mod_dav mod_dav_fs mod_dav_lock mod_lua prefork mod_proxy mod_lbmethod_bybusyness mod_lbmethod_byrequests mod_lbmethod_bytraffic mod_lbmethod_heartbeat mod_proxy_ajp mod_proxy_balancer mod_proxy_connect mod_proxy_express mod_proxy_fcgi mod_proxy_fdpass mod_proxy_ftp mod_proxy_http mod_proxy_scgi mod_proxy_wstunnel mod_ssl mod_systemd mod_cgi mod_perl mod_php7
以上显示 php7安装成功!
如何在CentOS Linux下安装ASTERISK和FreePBX
下面给出在linux上安装Asterisk,FreePBX的基本步骤。
1.首先是更新系统(可选)
在命令行中输入
sudo apt-get update
sudo apt-get upgrade
2.安装LAMP(Apache2+MySQL+PHP)
在命令行输入
sudo tasksel
选择 LAMP Server
3.添加额外的PHP软件包
sudo apt-get install php5-gd php-pear php-db sox curl
4.安装phpmyadmin(可选)
sudo apt-get install phpmyadmin
5.安装asterisk
sudo apt-get install asterisk asterisk-mysql asterisk-mp3
6.安装Freepbx准备工作
在安装Freepbx我们先要想好将Freepbx安装在哪个目录下,FreePBX为asterisk的Web管理应用,可以帮助用户配置Asterisk等。
1) Ubuntu的Web根目录为/var/www,因此我们可以把FreePBX安装到/var/www/freepbx目录下,为便于管理,创建三个子目录conf设置文件
log存放日志
public WEB应用。
sudo mkdir/var/www/freepbx/
sudo mkdir/var/www/freepbx/conf
sudo mkdir/var/www/freepbx/log
sudo mkdir/var/www/freepbx/public
2)创建设置文件/var/www/freepbx/conf/vhost.conf
sudo vim/var/www/freepbx/conf/vhost.conf
输入以下内容
<VirtualHost*:80>
ServerName freepbx
ServerAlias freepbx
ServerAdmin james.shen@guidebee.com
ErrorLog/var/www/freepbx/log/error.log
CustomLog/var/www/freepbx/log/access.log combined
DocumentRoot/var/www/freepbx/public
<Directory/var/www/freepbx/public>
Options Indexes FollowSymLinks MultiViews
Order allow,deny
AllowOverride All
Allow from all
</Directory>
<Directory/var/www/freepbx/public/admin>
AuthType Basic
AuthName"Restricted Area"
AuthUserFile freepbx-passwd
Require user admin
</Directory>
</VirtualHost>
修改 ServerAdmin到你自己的Email地址。
3)将vhost添加到 Apache的sites-enabled目录下
sudo ln-s/var/www/freepbx/conf/vhost.conf/etc/apache2/sites-available/freepbx
cd/etc/apache2/sites-enabled/
sudo ln-s../sites-available/freepbx
4)创建用户和密码来验证合法用户可以来配置FreePBX(有权限访问该网页)
sudo htpasswd-c/etc/apache2/freepbx-passwd admin
5)重启Apache
sudo/etc/init.d/apache2 restart
有了这些准备工作后,就可以开始安装FreePBX了
7.安装FreePBX
1)下载FreePBX安装包
cd/tmp
wget
cd/usr/src
sudo tar xvzf/tmp/freepbx-2.8.1.tar.gz
cd freepbx-2.8.1/
2)创建数据库
mysqladmin create asterisk-u root-p
mysqladmin create asteriskcdrdb-u root-p
mysql-u root-p asterisk< SQL/newinstall.sql
mysql-u root-p asteriskcdrdb< SQL/cdr_mysql_table.sql
3)创建数据库用户
mysql-u root-p
在SQL命令行输入GRANT ALL PRIVILEGES ON asterisk.* TO asterisk@localhost IDENTIFIED BY‘badasspassword’;
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asterisk@localhost IDENTIFIED BY‘badasspassword’;
flush privileges;
quit;
注意将badasspassword换成你自己选择的密码。
4)备份modules.conf, FreePBX安装时会修改Apache的配置文件
sudo cp/etc/asterisk/modules.conf~/asterisk-modules.conf
5)安装FreePBX
sudo./install_amp
输入对应的参数
Enter your USERNAME to connect to the'asterisk' database:
[asteriskuser] asterisk
Enter your PASSWORD to connect to the'asterisk' database:
[amp109] badasspassword
Enter the hostname of the'asterisk' database:
[localhost]
Enter a USERNAME to connect to the Asterisk Manager interface:
[admin]
Enter a PASSWORD to connect to the Asterisk Manager interface:
[amp111]
Enter the path to use for your AMP web root:
[/var/www/html]
/var/www/freepbx/public
Enter the IP ADDRESS or hostname used to access the AMP web-admin:
[xx.xx.xx.xx] freepbx
Enter a PASSWORD to perform call transfers with the Flash Operator Panel:
[passw0rd] password
Use simple Extensions [extensions] admin or separate Devices and Users [deviceanduser]?
[extensions]
Enter directory in which to store AMP executable scripts:
[/var/lib/asterisk/bin]
6)恢复asterisk-modules.conf
sudo cp~/asterisk-modules.conf/etc/asterisk/modules.conf
7)添加asterisk用户
sudo adduser www-data asterisk
修改权限/etc/amportal.conf中添加
AMPASTERISKUSER=www-data
AMPASTERISKGROUP=asterisk
AMPASTERISKWEBUSER=www-data
AMPASTERISKWEBGROUP=asterisk
重启amportal
sudo amportal start
8)使用amport启动Asterisk
sudo update-rc.d-f asterisk remove
sudo sed-e s/BACKGROUND=0/BACKGROUND=1/-i/usr/sbin/safe_asterisk
修改/etc/rc.local
在exit 0前添加
/usr/local/sbin/amportal start
至此,安装完毕。
phpinfo的Server API为CGI/FastCGI是什么模式
FastCGI应用速度很快是因为他们持久稳定。不必对每一个请求都启动和初始化。这使得应用程序的开发成为可能,否则在CGI范例是不切实际的(例如一个大型的脚本,或者一个需要连接单个或多个数据库的应用)。 1. FastCGI像是一个常驻(long-live)型的 CGI,它可以一直执行着,只要激活后,不会每次都要花费时间去 fork一次(这是 CGI最为人诟病的 fork-and-execute模式)。 2. FastCGI可在任何平台上使用,Netscape Enterprise及 IIS都有 FastCGI的模块可供使用,阿帕契(Apache,以及利用 Apache衍生出做的服务器)上也有 mod_fastcgi可用。 3. FastCGI支持 C/C++、Java、PHP、Python、Ruby、Perl,Tcl等程序语言。 4. FastCGI的应用程序亦兼容于 CGI。即 FastCGI的应用程序也可以当成 CGI来执行。 5.现有的 CGI程序要改写成 FastCGI非常简单,最少可能只需要多加入三行程序代码。 6. FastCGI的侦错方式与 CGI大同小异,只要带入程序所需的环境变量及参数,即可在命令列模式执行或侦错。 7. FastCGI应用程序的写作方式与 CGI类似,除了几项原则要特别注意外,FastCGI的写作方式跟 CGI几乎一样,与学习 Web Server API比较起来, FastCGI简单多了。 8. FastCGI支授分布式运算(distributed computing),即 FastCGI程序可以在网站服务器以外的主机上执行并且接受来自其它网站服务器来的请求。好处 1. PHP脚本运行速度更快(3到30倍)。PHP解释程序被载入内存而不用每次需要时从存储器读取,极大的提升了依靠脚本运行的站点的性能。 2.需要使用更少的系统资源。由于服务器不用每次需要时都载入PHP解释程序,你可以将站点的传输速度提升很高而不必增加cpu负担。因为dll文件不再每次都载入了,那么数据库的持久连接也将可以起到它设计初的效果。 3.不需要对现有的代码作任何改变。潜在问题 1.对所有的子目录(/home/USERNAME/public_html/php.ini)你只有一个可用的php.ini文件。这是优化网站代码所必需的。如果你需要多个php.ini文件以适应不同的脚本需要,你可以在任何子目录禁用PHP的快速CGI,而其余的地方则继续有效。 2.你对PHP环境做的任何升级(如php.ini文件的改变)都有几分钟的延迟。
你好。
centos6.4上用yum安装的apache,默认apache只加载了mod_cgi.so模块,并没有mod_fastcgi.so。
然后我配置由php-cgi处理.php后缀的文件,用phpinfo查看信息时,Server API处显示CGI/FastCGI。
FastCGI的应用程序亦兼容于 CGI,FastCGI的应用程序也可以当成 CGI来执行
FastCGI应用程序的写作方式与 CGI类似,除了几项原则要特别注意外,FastCGI的写作方式跟 CGI几乎一样。。。