centos pear 安装,centos7下载地址

大家好,今天给各位分享centos pear 安装的一些知识,其中也会对centos7下载地址进行解释,文章篇幅可能偏长,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在就马上开始吧!

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

至此,安装完毕。

Centos7如何安装PHP7最新版

方法一、简单安装(通过yum)

1.安装epel-release

rpm-ivh

2.安装PHP7的rpm源

rpm-Uvh

3.安装PHP7

yum install php70w

方法二、编译安装

1.下载php7

wget-O php7.tar.gz

2.解压php7

tar-xvf php7.tar.gz

3.进入php目录

cd php-7.0.4

4.安装依赖包

#直接复制下面一行(不包括本行)

yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel

5.编译配置(如果出现错误,基本都是上一步的依赖文件没有安装所致)

嫌麻烦的可以从这一步起参考PHP官方安装说明:

./configure\

--prefix=/usr/local/php\

--with-config-file-path=/etc\

--enable-fpm\

--with-fpm-user=nginx\

--with-fpm-group=nginx\

--enable-inline-optimization\

--disable-debug\

--disable-rpath\

--enable-shared\

--enable-soap\

--with-libxml-dir\

--with-xmlrpc\

--with-openssl\

--with-mcrypt\

--with-mhash\

--with-pcre-regex\

--with-sqlite3\

--with-zlib\

--enable-bcmath\

--with-iconv\

--with-bz2\

--enable-calendar\

--with-curl\

--with-cdb\

--enable-dom\

--enable-exif\

--enable-fileinfo\

--enable-filter\

--with-pcre-dir\

--enable-ftp\

--with-gd\

--with-openssl-dir\

--with-jpeg-dir\

--with-png-dir\

--with-zlib-dir\

--with-freetype-dir\

--enable-gd-native-ttf\

--enable-gd-jis-conv\

--with-gettext\

--with-gmp\

--with-mhash\

--enable-json\

--enable-mbstring\

--enable-mbregex\

--enable-mbregex-backtrack\

--with-libmbfl\

--with-onig\

--enable-pdo\

--with-mysqli=mysqlnd\

--with-pdo-mysql=mysqlnd\

--with-zlib-dir\

--with-pdo-sqlite\

--with-readline\

--enable-session\

--enable-shmop\

--enable-simplexml\

--enable-sockets\

--enable-sysvmsg\

--enable-sysvsem\

--enable-sysvshm\

--enable-wddx\

--with-libxml-dir\

--with-xsl\

--enable-zip\

--enable-mysqlnd-compression-support\

--with-pear\

--enable-opcache

6.正式安装

make make install

7.配置环境变量

vi/etc/profile

在末尾追加

PATH=$PATH:/usr/local/php/bin

export PATH

执行命令使得改动立即生效

source/etc/profile

8.配置php-fpm

cp php.ini-production/etc/php.ini

cp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf

cp/usr/local/php/etc/php-fpm.d/www.conf.default/usr/local/php/etc/php-fpm.d/www.conf

cp sapi/fpm/init.d.php-fpm/etc/init.d/php-fpm

chmod+x/etc/init.d/php-fpm

9.启动php-fpm

/etc/init.d/php-fpm start

如何在CentOS 7.9上安装PHP 8.1

在 CentOS 7.9的系统中,要安装 PHP 8.1,首先需要从 Remi's RPM仓库获取额外的软件资源。以下是详细的安装步骤:

1.首先,安装 EPEL(Extra Packages for Enterprise Linux)库,它为 CentOS提供额外软件包:

执行命令:sudo yum install-y

2.然后,安装 Remi's RPM仓库的 Rpm包:

执行命令:sudo yum install-y

3.启用 Remi's PHP 8.1仓库,确保能获取到 PHP 8.1的版本:

使用命令:sudo yum-config-manager--enable remi-php81

4.安装 PHP 8.1及其常用扩展,如 php-cli、php-fpm等:

运行安装命令:sudo yum install php php-cli php-fpm php-json php-common php-mysqlnd php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath

5.安装完成后,检查 PHP 8.1的版本以确认安装是否成功:

运行命令:php-v

这将显示 PHP 8.1的版本信息。至此,您已经在 CentOS 7.9系统上成功安装了 PHP 8.1。如果需要安装其他 PHP扩展,可以使用 `yum search php-`命令搜索并安装。

现在,您的系统已经具备了 PHP 8.1的基础环境,可以开始进行相关开发工作。

阅读剩余
THE END