Mac 中执行 composer update 会有如下异常:
1 2 |
> composer -vvv update --ignore-platform-reqs Allowed memory size of 1610612736 bytes exhausted xxxxxxx |
网上翻了翻,自己试了试,记录如下:
- 在 /etc 中找 php.ini,发现只有 php.ini.default,故 cp php.ini.default[……]
事后拂衣去,深藏功与名。
Mac 中执行 composer update 会有如下异常:
1 2 |
> composer -vvv update --ignore-platform-reqs Allowed memory size of 1610612736 bytes exhausted xxxxxxx |
网上翻了翻,自己试了试,记录如下:
先说结果:修改了fastcgi.conf中的配置解决问题。
服务器环境用lnmp自动安装的,头一次访问laravel的时候,报500错误,打开日志看了看,报错如下:
1 2 3 4 5 |
[23-May-2018 12:21:23 PRC] PHP Warning: require(): open_basedir restriction in effect. File(/data/.composer/vendor/testapp/vendor/autoload.php) is not within the allowed path(s): (/data/.composer/vendor/testapp/public/:/tmp/:/proc/) in /data/.composer/vendor/testapp/public/index.php on line 28 [23-May-2018 12:21:23 PRC] PHP Warning: require(/data/.composer/vendor/testapp/vendor/autoload.php): failed to open stream: Operation not permitted in /data/.composer/vendor/testapp/public/index.php on line 28 [23-May-2018 12:21:23 PRC] PHP Fatal error: require(): Failed opening required '/data/.composer/vendor/testapp/public/../vendor/autoload.php' (include_path='.:/usr/local/php/lib/php') in /data/.composer/vendor/testapp/public/index.php on line 28 |
看了看,大概意思是这样:
1,域名的根目录是:/[……]
事情,是这样的。
环境:某服务器
系统:CentOS 64位
现在想搭建一个PHP+Nginx+Memcached的环境。
随后分别用yum安装了这三个东西
1 2 3 |
[root@centos ~]# yum install php [root@centos ~]# yum install nginx [root@centos ~]# yum install memcached |
接下来修改了些配置文件,如:
[crayon-62[……]
PHP处理表单上传文件使用$_FILES[fieldName][‘error’]来标识正确与否与错误信息。详情如下。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
switch($_FILES[$field]['error']) { case 0: // 正常 break; case 1: // 文件大小超出了服务器的空间大小 $this->setError("The file is too large (server)."); break; case 2: // 要上传的文件大小超出浏览器限制 $this->setError("The file is too large (form)."); break; case 3: // 文件仅部分被上传 $this->setError("The file was only partially uploaded."); break; case 4: // 没有找到要上传的文件 $this->setError("No file was uploaded."); break; case 5: // 服务器临时文件夹丢失 $this->setError("The servers temporary folder is missing."); break; case 6: // 文件写入到临时文件夹出错 $this->setError("Failed to write to the temporary folder."); break; } |
再来记录一个简单的小玩意…不常用,所以要记录一下下…
filemtime ( string filename )
返回文件上次被修改的时间,出错时返回 FALSE。时间以 Unix 时间戳的方式返回,可用于 date()。
1 2 |
$a=filemtime("log.txt"); echo "修改时间:".date("Y-m-d H:i:s",$a); |
[……]
问题不怕弱智…啥都记
1 2 3 4 5 |
function getmicrotime() { list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec); } |
[……]