草庐IT

消息Nginx

全部标签

php - Nginx 为静态文件代理不正确的 fastcgi_script_name

server{listenloc.app:80;root/app/frontend/web;indexindex.php;location/{try_files$uri$uri//index.php$is_args$args;}location~^/admin{proxy_passhttp://127.0.0.1:81;}location~*\.php${#phpconf}}server{listen127.0.0.1:81;root/app/backend/web;indexindex.php;location/{try_files$uri$uri//index.php$is_arg

php - 在 Docker 中通过 Nginx 的多个版本的 PHP

我为PHP5.6运行了两个docker容器:dockerrun--namephp5\-v/html1:/var/www/html/site1\-d-p9001:9000php:5.6-fpm对于PHP7:dockerrun--namephp7\-v/html2:/var/www/html/site2\-d-p9000:9000php:7-fpm我用Nginx运行Docker容器:dockerrun--namenginx-cache\-v/nginx.conf:/etc/nginx/nginx.conf\-v/nginx/html1:/var/www/html/site1\-v/ngin

php - 消息 : Call to a member function get_users() on a non-object

嗨,我正在使用codeigniter,对此我还很陌生。我正在做一个简单的程序来显示数据库中的数据。但我有错误!这是我的代码Controller文件用户.phpclassUserextendsCI_Controller{publicfunctionshow(){$result=$this->user_model->get_users();foreach($resultas$object){echo$object->id;}}}?>模型文件用户模型.phpclassUser_modelextendsCI_Model{publicfunctionget_users(){$fetch=$thi

php - 如何自定义 Zend_Form 正则表达式错误消息?

我有以下代码:$postcode=$form->createElement('text','postcode');$postcode->setLabel('Postcode:');$postcode->addValidator('regex',false,array('/^[a-z]{1,3}[0-9]{1,3}?[0-9]{1,3}[a-z]{1,3}$/i'));$postcode->addFilters(array('StringToUpper'));$postcode->setRequired(true);它在表单中创建一个输入字段并设置一个正则表达式验证规则并且工作正常。问题

php - Kohana 3 中的 i18n 和错误消息

我正在使用Kohana3开发一个管理应用程序,显然我要处理很多表单。应用程序需要多语言,我对如何管理我的消息文件,尤其是如何访问它们感到非常困惑。i18n是否支持语言文件夹内的不同文件夹和文件?例如:国际化zh表单fr表单或者语言文件中是否支持数组?i18n/fr.phparray('error_type'=>'ErrormessageinFrench.','error_type_2'=>'Othererrormessage.',))如果可以的话,您将如何在翻译消息时访问这些字段/文件?我不明白的另一件事是我如何以某种方式将我的翻译链接到messages文件夹中的错误消息。这让我很困惑

php - 使 zend EmailAddress 表单验证器仅返回一条自定义错误消息

我正在创建一个像这样的电子邮件表单元素(在Zend表单中)://createe-mailelement$email=$this->createElement('text','username')->setLabel('E-mail:')->setRequired(true)->addFilters(array('StringTrim','StringToLower'))->addValidator('EmailAddress',false,array('messages'=>array(Zend_Validate_EmailAddress::INVALID=>'Dite-mailadr

php - 如何在 Nginx 配置文件中配置 Phalcon

我正在尝试设置NGINx服务器以使用PhalconPHP框架。到目前为止,我一直在互联网上寻求帮助,但找不到任何东西......我的配置文件是:server{#listen80;##listenforipv4;thislineisdefaultandimplied#listen[::]:80defaultipv6only=on;##listenforipv6root/usr/share/nginx/www;indexindex.phpindex.htmlindex.htm;#Makesiteaccessiblefromhttp://localhost/server_namelocalh

PHP Nginx error_log 被截断

我正在运行nginx和PHP5.5,当传递的字符串很长时,我所有的error_log消息都会被截断。我已经更新了我的php.ini文件并将日志最大长度从1024增加到0(无最大值)并且它仍在发生。 最佳答案 如果你想要超过2048字节的日志行,你需要重新编译Nginx。来自http://wiki.nginx.org/HttpLuaModule:Nginx核心中的错误消息有硬编码的长度限制。最多2048字节,包括尾随换行符和前导时间戳。您可以通过修改Nginx源代码树中src/core/ngx_log.h文件中的NGX_MAX_ERR

php - 未捕获的异常 'ImagickException',消息为 'Unable to read the file'

我正在运行带有imagick模块3.1.0RC2的PHP5.4.30。phpinfo()确实将模块显示为已加载,而phpinfo()将PDF显示为受支持的格式。运行时:$image=newImagick();$image->readImage('./test.pdf');我收到:fatalerror:未捕获的异常“ImagickException”和消息“无法读取文件:./test.pdf”当我将图像类型更改为JPEG并读取'./test.jpg'时,未返回任何错误。已检查权限并测试了不同的PDF。我已经插入了图像的绝对路径,但仍然抛出异常。此示例的图像与脚本放在同一目录中。我错过了什

Nginx 别名指令不适用于 php

我有一个在Nginx上运行的应用程序,它的工作服务器block如下所示:server{listen80;server_nameexample.com;root/home/deployer/apps/my_app/current/;indexindex.php;location/{indexindex.php;try_files$uri$uri/;}location~\.php${try_files$uri=404;fastcgi_split_path_info^(.+\.php)(/.+)$;fastcgi_passunix:/home/deployer/apps/shared/php