b2c信息网

您现在的位置是:首页 > 明日新闻 > 正文

明日新闻

mcrypt.h源码(mcrypt_encrypt)

hacker2022-11-15 22:30:29明日新闻103
本文目录一览:1、缺少mcrypt扩展。请检查PHP配置。2、

本文目录一览:

缺少 mcrypt 扩展。请检查 PHP 配置。

phpinfo()看看是否有mcrypt,应该是没有的,你用的应该是ubuntu吧,在php源码的ext文件夹里有mcrypt扩展,这个需要编译,扩展编译好后有个mcrypt.so的文件,copy到php扩展目标,修改php.ini文件,然后重新启动php

php 怎么用zend加密

可以加密就可以解密。

解密ZEND加密后的PHP文件:

zend加密php文件解密工具Dezender可以做到。

1、下载Dezender.zip

2、解压到盘里面,最好不要有中文路径,比如解压到 I:\Dezender 里面,修改 I:\Dezender\PHP5\PHP5\php.ini文件,修改里面的文件路径。

3、打开cmd命令行

然后就可以看见文件目录下面会多出一个文件    文件名.de.php

4、进入I:\Dezender 目录下面的

5、写一个批处理文件,可以直接把一个目录下面的文件全部批量解密

如何在openSUSE42.1下编译安装PHP7

首先推荐一篇文章

PHP

7

Release

Date

Arrived:

Will

Developers

Adopt

PHP

7?

-

PHP

Classes

blog

里面说到是否会去使用PHP7,就个人而言,我是毫不犹豫地使用的,但是生产环境就不是我说了算,所以只能自己在自己的开发环境里更新PHP的版本。那么,你呢?

笔者使用的是Linux的openSUSE42.1发行版,Yast里面还没有PHP7的安装包,于是乎只能自己手动编译安装了。作为一个PHP开发者,我是非常希望能够学会编译安装PHP7的,之前试过几次,但是每次安装都要上网找各种资料,于是乎,这次安装成功后就想把自己的安装过程以及遇到的问题记录下来,方便以后查阅和分享给需要的人。

下载源码并解压

进入正题,要编译安装PHP7,首先当然要下载PHP7的源码。你可以到

github

上clone,也可以到

PHP官网

下载。下载后解压到

/usr/local/src

目录,并将目录重命名为php7。进入目录。

配置编译参数

生成配置文件

./buildconf

配置

./configure

\

--prefix=/usr/local/php7

\

--exec-prefix=/usr/local/php7

\

--bindir=/usr/local/php7/bin

\

--sbindir=/usr/local/php7/sbin

\

--includedir=/usr/local/php7/include

\

--libdir=/usr/local/php7/lib/php

\

--mandir=/usr/local/php7/php/man

\

--with-config-file-path=/usr/local/php7/etc

\

--with-mysql-sock=/var/run/mysql/mysql.sock

\

--with-mcrypt=/usr/include

\

--with-mhash

\

--with-openssl

\

--with-mysqli=shared,mysqlnd

\

--with-pdo-mysql=shared,mysqlnd

\

--with-gd

\

--with-iconv

\

--with-zlib

\

--enable-zip

\

--enable-inline-optimization

\

--disable-debug

\

--disable-rpath

\

--enable-shared

\

--enable-xml

\

--enable-bcmath

\

--enable-shmop

\

--enable-sysvsem

\

--enable-mbregex

\

--enable-mbstring

\

--enable-ftp

\

--enable-gd-native-ttf

\

--enable-pcntl

\

--enable-sockets

\

--with-xmlrpc

\

--enable-soap

\

--without-pear

\

--with-gettext

\

--enable-session

\

--with-curl

\

--with-jpeg-dir

\

--with-freetype-dir

\

--enable-opcache

\

--enable-fpm

\

--disable-cgi

\

--with-fpm-user=nginx

\

--with-fpm-group=nginx

\

--without-gdbm

\

--disable-fileinfo

参数说明

prefix

PHP7安装的根目录

with-config-file-path

PHP7的配置文件目录

执行完上面的配置命令后的结果如下图所示:

执行上面命令的过程中会遇到一些依赖缺少的提示,下面列出我遇到的依赖问题:

错误:

configure:

error:

xml2-config

not

found.

Please

check

your

libxml2

installation.

解决:

zypper

install

libxml2-devel

错误:

configure:

WARNING:

unrecognized

options:

--with-mysql

解决:

取消这个选项,这个选项是不存在的

错误:

configure:

error:

jpeglib.h

not

found.

解决:

zypper

install

libjpeg-devel

错误:

configure:

error:

mcrypt.h

not

found.

Please

reinstall

libmcrypt.

解决:

zypper

install

libmcrypt-devel

错误:

checking

for

recode

support...

yes

configure:

error:

Can

not

find

recode.h

anywhere

under

/usr

/usr/local

/usr

/opt.

解决:

zypper

install

librecode-devel

总的来说,在配置的时候遇到没有的就打开Yast搜一下,如果有的话就安装,然后重新编译看还需要那些,如果在Yast找不到,那就上网找一下Google。

编译和安装PHP7

make

make

install

其中,make之后可以选择make

test。只是一个可选步骤,不执行不知道有什么问题,不过笔者暂时还没遇到。

查看安装成功后的PHP7目录

编译安装成功后,查看PHP7的安装目录`ls

/usr/local/php7`:

设置PHP7的配置文件

cp

/usr/local/src/php7/php.ini-production

/usr/local/php7/etc/php.ini

cp

/usr/local/src/sapi/fpm/init.d.php-fpm

/etc/init.d/php-fpm

cp

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

/usr/local/php7/etc/php-fpm.conf

cp

/usr/local/php7/etc/php-fpm.d/

/usr/local/php7/etc/php-fpm.d/

设置环境变量

在/etc/profile

文件的最后一行加上

export

PATH=/usr/local/php7/bin:/usr/local/php7/sbin:$PATH

然后执行

source

/etc/profile

设置PHP日志目录和php-fpm进程文件(php-fpm.sock)目录

mkdir

-p

/var/log/php-fpm/

mkdir

-p

/var/run/php-fpm

cd

/var/run/

chown

-R

nginx:nginx

php-fpm

将PHP设置为开机启动

chmod

+x

/etc/init.d/php-fpm

chkconfig

php-fpm

on

可以用chkconfig命令查看开机启动服务列表。

启动PHP服务

service

php-fpm

start

通过ps

aux

|

grep

'php'查看PHP是否启动成功

至此,PHP7就安装成功了,你也开始使用PHP7吧!

mcrypt和 libmcrypth的区别

解决办法一

1、安装第三方yum源

wget

sh ./atomic

2、使用yum命令安装

yum install php-mcrypt libmcrypt libmcrypt-devel

解决办法二、

使用php mcrypt 前必须先安装Libmcrypt

libmcrypt源码安装方法:

cd /usr/local/src

wget

tar -zxvf libmcry pt-2.5.8.tar.gz

cd /usr/local/src/libmcrypt-2.5.8

./configure --prefix=/usr/local

make

make install

debian8怎么安装php7

debian8 编译安装 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

mcrypt安装完毕,但是没有mcrypt.so文件,应该怎么开启这个库

MCrypt是一个功能强大的加米算法扩展库,它包括有22种算法。

1:下载并解压mcrypt-2.6.8.tar.bz2。(2.6.8为版本号,可以自行选择,但是注意后边步骤要与下载的版本号一致。)2:在终端执行命令(注意如下命令需要安装xcode支持):

cd ~/Downloads/mcrypt-2.5.8

./configure --disable-posix-threads --enable-staticmake

sudo make install

3:下载并解压php源码,根据自己情况选择对应版本。(注意以下命令中php的版本)在终端执行命令:(如果出错请看后边)

cd ~/Downloads/php-5.5.14/ext/mcrypt

phpize

./configure

make

cd modules

sudo cp mcrypt.so /usr/lib/php/extensions/no-debug-non-zts-20121212/(cd modules后当出现

Build complete.

Don't forget to run 'make test'.

表示安装成功。)

4:打开php.ini

sudo vi /etc/php.ini

添加如下代码:(注意no-debug-non-zts-20121212版本号,如果不清楚可以前往/usr/lib/php/extensions/查看)extension=/usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so*如果phpize出现如下错误:

grep: /usr/include/php/main/php.h: No such file or directorygrep: /usr/include/php/Zend/zend_modules.h: No such file or directorygrep: /usr/include/php/Zend/zend_extensions.h: No such file or directoryConfiguring for:

PHP Api Version:

Zend Module Api No:

Zend Extension Api No:

Cannot find autoconf. Please check your autoconf installation and the$PHP_AUTOCONF environment variable. Then, rerun this script.

表示需要安装autoconf

*如果make出现如下错误:

/ext/mcrypt/mcrypt.c:25:10: fatal error: 'php.h' file not found执行如下命令即可:

sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include /usr/include*注意MacOSX10.10.sdk修改为自己系统的版本号*

发表评论

评论列表

  • 只酷迟山(2022-11-16 06:38:05)回复取消回复

    pt.so的文件,copy到php扩展目标,修改php.ini文件,然后重新启动phpphp 怎么用zend加密可以加密就可以解密。解密ZEND加密后的PHP文件:zend加

  • 山有枢(2022-11-16 02:40:58)回复取消回复

    v libssl-dev libbz2-dev libjpeg-dev libpng-dev libxpm-dev libfreetype6-dev libgmp-dev libgmp3-dev libmcrypt-dev libmysqlcli

  • 泪灼徒掠(2022-11-16 09:06:15)回复取消回复

    type6-dev libgmp-dev libgmp3-dev libmcrypt-dev libmysqlclient15-dev libpspell-dev librecode-dev进行编译安装./buildconf //用来生成configure脚本./confi