很多站长朋友们都不太清楚phpwith-gmp,今天小编就来给大家整理phpwith-gmp,希望对各位有所帮助,具体内容如下:
本文目录一览: 1、 阿里云默认centos7上怎么安装php 2、 PHP单独添加扩展 无需重启服务器 3、 请开启PHP的GMP支持 4、 debian8怎么安装php7 5、 新手求教.如何支持php gmp 阿里云默认centos7上怎么安装php首先更新系统软件</str>
$ yum update
安装nginx</str></str>
1.安装nginx源
$ yum localinstall .安装nginx
$ yum install nginx
3.启动nginx
$ service nginx start
Redirecting to /bin/systemctl start nginx.service4.访问http://你的ip/
如果成功安装会出来nginx默认的欢迎界面
安装MySQL5.7.*
</str>
1.安装mysql源</str>
$ yum localinstall .安装mysql
$ yum install mysql-community-server
确认一下mysql的版本,有时可能会提示mysql5.63.安装mysql的开发包,以后会有用
$ yum install mysql-community-devel
4.启动mysql
$ service mysqld start
Redirecting to /bin/systemctl start mysqld.service5.查看mysql启动状态
$ service mysqld status
出现pid
证明启动成功
6.获取mysql默认生成的密码
$ grep 'temporary password' /var/log/mysqld.log2015-12-05T05:41:09.104758Z 1 [Note] A temporary password is generated for root@localhost: %G1Rgns!dD!v</str>
加粗的就是生成的密码
7.换成自己的密码
$ mysql -uroot -p
Enter password:输入上面的密码
成功输入后进入一下步,这里你估计会输入 好几次才进去8. 更换密码
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';这个密码一定要足够复杂,不然会不让你改,提示密码不合法;9.退出mysql;
mysql> quit;
10.用新密码再登录,试一下新密码
$ mysql -uroot -p
Enter password:输入你的新密码
11.确认密码正确后,退出mysql;
mysql> quit;
编译安装php7.0.0
</str>
</str>
1.下载php7源码包</str>
$ cd /root wget -O php7.tar.gz .解压源码包</str>
$ tar -xvf php7.tar.gz
3.</str>
$ cd php-7.0.1
4.安装php依赖包</str>
</str>
$ 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-devel5.编译配置,这一步我们会遇到很多configure error,我们一一解决,基本都是相关软件开发包没有安装导致</str>
</str>
$ ./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
configure error:
1.configure: error: xml2-config not found. Please check your libxml2 installation.
解决:
$ yum install libxml2 libxml2-devel
2.configure: error: Cannot find OpenSSL's <evp.h>
解决:
$ yum install openssl openssl-devel
3.configure: error: Please reinstall the BZip2 distribution解决:
$ yum install bzip2 bzip2-devel
4.configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/解决:
$ yum install libcurl libcurl-devel
5.If configure fails try --with-webp-dir=<DIR> configure: error: jpeglib.h not found.
解决:
$ yum install libjpeg libjpeg-devel
6.If configure fails try --with-webp-dir=<DIR>
checking for jpeg_read_header in -ljpeg... yesconfigure: error: png.h not found.
解决:
$ yum install libpng libpng-devel
7.If configure fails try --with-webp-dir=<DIR>
checking for jpeg_read_header in -ljpeg... yeschecking for png_write_image in -lpng... yesIf configure fails try --with-xpm-dir=<DIR>
configure: error: freetype-config not found.
解决:
$ yum install freetype freetype-devel
8.configure: error: Unable to locate gmp.h解决:
$ yum install gmp gmp-devel
9.configure: error: mcrypt.h not found. Please reinstall libmcrypt.
解决:
$ yum install libmcrypt libmcrypt-devel
10.configure: error: Please reinstall readline - I cannot find readline.h解决:
$ yum install readline readline-devel
11.configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution解决:
$ yum install libxslt libxslt-devel
6.编译与安装
$ make make install
这里要make好久,要耐心一下
7.添加 PHP 命令到环境变量
$ vim /etc/profile
在末尾加入
PATH=$PATH:/usr/local/php/bin
export PATH
要使改动立即生效执行
$ ./etc/profile
或
$ source /etc/profile
查看环境变量
$ echo $PATH
查看php版本
$ php -v
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/ /usr/local/php/etc/php-fpm.d/ 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
配置nginx虚拟机,绑定域名</str>
1.
</str>
$ vim /etc/nginx/conf.d/php7.thinkcmf测试数据.conf这里可以把php7.thinkcmf测试数据.conf改成自己的域名把下面的内容复制到php7.thinkcmf测试数据.conf里server{
listen 80;
server_name php7.thinkcmf测试数据;
root /var/www/html/php7.thinkcmf测试数据; # 该项要修改为你准备存放相关网页的路径location / {
index index.php index.html index.htm;
#如果请求既不是一个文件,也不是一个目录,则执行一下重写规则if (!-e $request_filename)
{
#地址作为将参数rewrite到index.php上。
rewrite ^/(.*)$ /index.php/$1;
#若是子目录则使用下面这句,将subdir改成目录名称即可。
#rewrite ^/subdir/(.*)$ /subdir/index.php/$1;}
}
#proxy the php scripts to php-fpm
location ~ \.php {
include fastcgi_params;
##pathinfo支持start
#定义变量 $path_info ,用于存放pathinfo信息set $path_info "";
#定义变量 $real_script_name,用于存放真实地址set $real_script_name $fastcgi_script_name;#如果地址与引号内的正则表达式匹配
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {#将文件地址赋值给变量 $real_script_name
set $real_script_name $1;
#将文件地址后的参数赋值给变量 $path_info
set $path_info $2;
}
#配置fastcgi的一些参数
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;fastcgi_param SCRIPT_NAME $real_script_name;fastcgi_param PATH_INFO $path_info;
###pathinfo支持end
fastcgi_intercept_errors on;
fastcgi_pass 127.0.0.1:9000;
}
}
2.重启nginx
$ service nginx reload
3.
$ vim /var/www/html/php7.thinkcmf测试数据/index.php</str>
把下面的代码复制到这个文件 里
<?php
phpinfo();
4.查看访问
PHP单独添加扩展 无需重启服务器问题
php自身提供了很多扩展,比如curl,gmp, mbstring等等。我们在编译安装php时未必安装了所有扩展。那么在安装完php后,如果想单独安装某个php自身的扩展怎么办呢?
我们以curl扩展模块的安装为例说明如何单独添加扩展。
步骤
1.进入php源码的扩展目录。本例中我的源码对应目录如下:
/search/src/php-7.0.14/ext
1
2.进入模块目录,我们安装的是curl扩展,所以进入curl目录。此时,我们所在的目录是
/search/src/php-7.0.14/ext/curl
1
3.执行phpize。注意,如果你的机器上有多个php版本,一定要执行你准备安装扩展的php版本对应的phpize。比如,我的机器上同时有php7和php5.3.3。我当前准备为php7安装curl扩展。所以执行php7对应的phpize
1 /usr/local/php70/bin/phpize
2
3 结果类似:
4 Configuring for:
5 PHP Api Version: 20151012
6 Zend Module Api No: 20151012
7 Zend Extension Api No: 320151012
4.执行
./configure --with-php-config=/usr/local/php70/bin/php-config
1
说明:如果你的机器上只有一个php版本,大多时候不需要特别使用–with-php-config指明相应的php-config所在位置。
5.执行make,之后会在./modules/目录下生成curl.so文件
6.执行make install
结果类似:
Installing shared extensions: /usr/local/php70/lib/php/20151012/
1
2
执行结果告诉你将curl.so安装到了哪个目录。
一般情况,如果你正确的指定了php-config或者你的机器只有一个php版本,so都会被正确安装到相应php的extension_dir。如果执行make install后,extension_dir目录下没有相应的so,可以手动将第5步中生成的so文件cp过去。
要查看具体extension_dir,可以执行如下命令。
php -i| grep extension_dir
结果类似
extension_dir => /usr/local/php70/lib/php/20151012/ => /usr/local/php70/lib/php/20151012/
1
2
3
7.在php.ini中增加
extension=curl.so
1
如果不知道php.ini的具体位置,可以通过如下命令查看
php --ini
1
8.执行如下命令,查看是否安装成功
php -m | grep curl
1
如果你看到了curl, 恭喜你,安装成功!
请开启PHP的GMP支持php 安装包中就存在安装方法。下面资料是在 %php root%\install.txt 文件中提到的。我通常都按照这个方法配置 IIS + php ,白试百灵。当然 php 离开 MySQL 就不精彩了,有时间你在配置一个 MySQL 出来,就很够用了。 WinNT + IIS + php + MySQL 虽然在使用上没有 Linux + Apache + php + MySQL 来的高速,可是做为调试环境还是非常方便的。
IIS 4.0+ (CGI)
1. Copy the php.ini-dist to your systemroot (the directory where you installed windows), rename it to php.ini, and
edit it to fit your needs
2. Start the Microsoft Management Console (may appear as 'Internet Services Manager', either in your Windows NT 4.0
Option Pack branch or the Control Panel->Administrative Tools under Windows 2000).
3. Right click on your Web server node (will most probably appear as 'Default Web Server'), and select 'Properties'.
4. Under 'Home Directory', click on the 'Configuration' button. Add a new
5. entry to the Application Mappings; Use the path to php.exe as the Executable, supply .php as the extension, leave
'Method exclusions', blank, and check the Script engine checkbox.
6. Put a .php file under your Web server's document root and check if it works!
================================================================================
PHP 在 IIS (CGI) 中的安装 (翻译兼心得)
1、 复制 php.ini-dist 文件岛你的系统文件夹(在你安装Windows 的文件夹下,比如 C:\Windows 或者 C:\WINNT 下),将该文件改名为 php.ini , 按照你需要的配置修改文件中的设置内容。
2、 打开 "Microsoft 管理控制台" ( 也许在你的系统中被称作 "Internet 服务管理器" , 尝试打开 开始 -> 设置-> 控制面板 -> 管理工具 -> Internet 服务管理器, 在你的 Windows 2000 / XP / 2003 下)。
3、 鼠标右键单击你的站点的根目录接点 ( 显示在控制台的左侧的属性管理器中,或许在 Internet 服务管理器 -> pascal(你的机器名) -> 默认Web站点 ),在弹出菜单中选择 "属性"。
4、 在 "主目录" 选项卡中单击 "配置" 按钮,打开 "应用程序配置" 对话框。
5、 进入 "应用程序映射" 选项卡, 添加一个新的项目 用 php.exe 的全路径 (如 "C:\Program Files\PHP\php.exe" 或者 C:\PHP\php.exe) 添加到 "可执行文件" 文本框, ".php" 作为 "扩展名", "动作" 项选择 "全部" (我个人推荐), 选择 "脚本引擎" 复选框,如法炮制 可以添加一些别的扩展名支持,如 .php3 .php4 等。按确定按钮或者应用按钮保存配置。
6、 放置一个 .php 的文件在你的WEB服务器的根目录所在的文件夹下,执行一下,看看效果。
当然测试的时候不一定非要把文件放在 web 根目录下,也可以放在虚拟文件夹下测试。
debian8怎么安装php7debian8 编译安装 php7
目录(?)[-]
Please reinstall the libcurl distributionCannot find OpenSSL
configure error Unable to locate gmph
Can not find recodeh anywhere under usr usrlocal usr optCannot find pspell
Please reinstall the mysql distribution
mcrypth not found Please reinstall libmcryptxml2-config not found
安装编译器
apt-get install build-essential autoconf automake libtool bison re2c获取PHP安装包
wget 安装dev包
apt-get install libxml2-dev libssl-dev libbz2-dev libjpeg-dev libpng-dev libxpm-dev libfreetype6-dev libgmp-dev libgmp3-dev libmcrypt-dev libmysqlclient15-dev libpspell-dev librecode-dev进行编译安装
./buildconf //用来生成configure脚本
./configure \
--prefix=/usr \
--with-config-file-path=/etc \
--enable-mbstring \
--enable-zip \
--enable-bcmath \
--enable-pcntl \
--enable-ftp \
--enable-exif \
--enable-calendar \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-curl \
--with-mcrypt \
--with-iconv \
--with-gmp \
--with-pspell \
--with-gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--with-xpm-dir=/usr \
--with-freetype-dir=/usr \
--with-t1lib=/usr \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-openssl \
--with-pdo-mysql=/usr \
--with-gettext=/usr \
--with-zlib=/usr \
--with-bz2=/usr \
--with-recode=/usr \
--with-mysqli=/usr/bin/mysql_config
备注:错误1:Cannot find OpenSSL's libraries 解决:
确认已安装过 openssl、libssl-dev 包,还是会提示该错误;解决办法:
root@test2:~/php-5.3.27# find / -name libssl.so输出结果为: /usr/lib/x86_64-Linux-gnu/libssl.so初步判断它可能只会在 /usr/lib/ 下寻找 libssl.so 文件,于是:
ln -s /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib错误2:debian Please reinstall the libcurl distribution 解决:
# RetHat CentOS or Fedora 使用下面安装命令yum install curl curl-devel
# Debian or Ubuntu使用下面的安装命令
apt-get install curl
apt-get install libcurl4-gnutls-dev
错误3:Unable to locate gmp.h 解决:
在 下载 gmp源码包,接着 ./configure make make install编译 安装
make make install
报错处理
Please reinstall the libcurl distributionaptitude search libcurl4
aptitude install libcurl4-gnutls-dev
Cannot find OpenSSL’
wget -zxvf openssl-1.0.2j.tar.gz
cd openssl-1.0.2j
./config
make make install
configure: error: Unable to locate gmp.h
sudo apt-get install libgmp-dev libgmp3-devln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.hCan not find recode.h anywhere under /usr /usr/local /usr /opt.
apt-get install librecode-dev
Cannot find pspell
apt-get install libpspell-dev
Please reinstall the mysql distribution
apt-get install libmysqlclient15-dev
mcrypt.h not found. Please reinstall libmcrypt.
apt-get install libmcrypt-dev
xml2-config not found
apt-get install libxml2-dev
新手求教.如何支持php gmp所有php模块的安装参考这个
你安装不成功也要贴个 错误信息
gmp安装应该需要提前自己安装好依赖包,ubuntu下应该是 apt-get install libgmp-dev
安装lnmp的话可以自己修改lnmp.conf 在 PHP_Modules_Options='' 单引号中加入 --with-gmp 但已有必须要安装前安装好所需的依赖包
关于phpwith-gmp的介绍到此就结束了,不知道本篇文章是否对您有帮助呢?如果你还想了解更多此类信息,记得收藏关注本站,我们会不定期更新哦。
查看更多关于包含phpwith-gmp的词条的详细内容...