centos安装gmp(centos7安装卡在安装源)

阿里云上的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安装成功!

centos7怎么编译安装gcc-c++

方法/步骤

1

yum install glibc-static libstdc++-static-y

安装c和c++的静态库(据说如果系统中缺少libc.a和libstdc++.a编译时会出错,但是我没有那么多闲情逸致去试,实践过的朋友可以回复一下,分享一下经验,让大家都长长见识)

2

下载解压gcc,我的gcc目录是gcc-4.8.0

3

进入gcc目录,执行:

./contrib/download_prerequisites

这个神奇的脚本文件会帮我们下载、配置、安装那三个依赖的库。可以节约我们大量的时间和精力。

4

你以为这三个库自动下载了、自动make install了就没事了吗?错!

很多人在编译gcc的时候出现各种奇奇怪怪的错误就是这步没有做好。

它们还不在.so文件的搜索路径里面,需要加进去,最后切记切记一定要执行一下ldconfig。

大致做法为:

1,找到你的共享库文件被install到哪个目录了(updatedb+locate命令)。

2,如果你的库不是直接放在/lib或/usr/lib下,需要修改/etc/ld.so.conf文件,加入你的共享库的路径

3,如果在2中添加了共享库路径,切记要执行一下ldconfig,更新响应cache文件让系统能找到你的共享库。

5

建立临时目录,这个目录用以存放编译时的大量临时文件,是文档要求中必须的。

我是在gcc-4.8.0下建立了一个名为gcc-build-4.8.0的目录,进入它。

mkdir gcc-build-4.8.0

cd gcc-build-4.8.0

配置gcc编译选项

6

强烈建议阅读INSTALL目录下的说明文档,尤其是configure.html,以确定你的编译选项。

比较基本的选项有--enable-languages,说明你要让你的gcc支持那些语言,--disable-multilib不生成编译为其他平台可执行代码的交叉编译器。--disable-checking生成的编译器在编译过程中不做额外检查,也可以使用--enable-checking=xxx来增加一些检查。

网上还说了什么--with-gmp、--with-mpfr、--with-mpc这三个选项,但是如果你3,4步做好了,就不要配了,反之你还是老实点吧别抱侥幸心理了。

调用gcc-4.8.0目录下的configure文件:

例如:

../configure--enable-checking=release--enable-languages=c,c++--disable-multilib

7

执行

../make#不解释

执行编译命令(#在8核的虚拟机上进行编译,每个核分配2个编译任务)

make-j16

make install编译过程CPU核基本100%占用,整个编译用时11分50秒。

检查gcc版本

#你就等吧少年,建议晚上睡觉前做

当然上面三步一定要在前一步顺利结束的情况下进行,如果哪一步出错了,结果都显示error了,就不要再做后面的了。在shell的输出里搜索"error"看具体的出错点是什么,baidu、google一下为什么。

如果你求稳的话,可以在make install之前先make check一下。

如何在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

至此,安装完毕。

阅读剩余
THE END