阿里云Centos7 yum安装PHP7.2 LNMP环境配置 (centos7.6+nginx+MySQL5.7+PHP7.2)

首先更新系统软件$ yum update安装nginx1.安装nginx源:yum localinstall http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm2.安装nginxyum install ngin
阅读全文

编译php扩展

使用phpize编译扩展,如果phpize没有加入到环境变量的话,使用全路径,一般为:/usr/local/php/bin/phpize如果运行了phpize发现没有生成configure文件的话,说明没有安装autoconf,使用一下命令安装:yum -y install autoconf然后重新使用命令:phpize然后:./configure --wi
阅读全文

thinkphp5.0.24不加载extra文件夹下的扩展配置

  • Barley
  • 2019-02-21 16:08:54
  • PHP
  • PHP
如果发现config('xx');无法获取到设置的参数,但是config.php 里的参数又能正确获取的话: 去:thinkphp/library/think/App.php  文件的 260行左右将原来的:Config::load($filename, pathinfo($file, PATHINFO_FILENA
阅读全文

PHP date_modify() 函数

<?php $date=date_create("2019-01-30"); date_modify($date,"+4 days"); echo date_format($date,"Y-m-d");date_modify() 函数修改时间戳
阅读全文

php报错Can't find PHP headers in /usr/include/php

一行代码:yum install php-devel
阅读全文

HTML页面跳转的方法

1、html中使用meta中跳转,通过meta可以设置跳转时间和页面<head> <!--只是刷新不跳转到其他页面 --> <meta http-equiv="refresh" content="5"> <!--定时转到其他页面 --> <meta 
阅读全文

PHP合并数组及去重

<?php  $arr1 = [1,2,3,4,5]; $arr2 = [1,2,3,6,7]; $arr3 = ['0'=>1,'1'=>2,'2'=>3,'3'=>4,'4'=>5]; $arr4&nb
阅读全文

PHP保留两位小数的几种方法

<?php  $num = 10.4567;       //第一种:利用round()对浮点数进行四舍五入 echo round($num,2); //10.46   //第二种:利用sprintf格式化字符串 $format_num = sp
阅读全文

array_intersect_uassoc()函数

  • Barley
  • 2019-01-18 09:43:08
  • PHP
  • PHP
<?php function myfunction($a,$b) { if ($a===$b)   {   return 0;   }   return ($a>$b)?1:-1; } $a1=array("a"=>&q
阅读全文

thinkphp 3.2的cli模式(命令行模式)的正确使用方法

最近要使用thinkphp3.2版本的cli模式,手动执的话没有问题,比如php /www/index.php home/article/get这样没有问题,但是一般用cli模式都是定时任务比较多,这个时候写到定时任务的时候,比如0 * * * * * php /www/index.php home
阅读全文