[horde] Error when communicating with the server
Andy Dorman
adorman at ironicdesign.com
Tue Sep 3 17:40:15 UTC 2013
Please do not top post...my response is at the bottom.
On 09/03/2013 11:08 AM, José Eduardo Martins wrote:
> Andy,
>
> I am running Linux Mageia 3, nginx 1.2.9 and php 5.4.19.
>
> In the nginx side, I only changed /etc/nginx/nginx.conf that have this:
>
> ====== snip start ======================================
> worker_processes 4;
>
> events {
> worker_connections 1024;
> }
>
> http {
> include mime.types;
> default_type application/octet-stream;
>
> sendfile off;
>
> keepalive_timeout 65;
>
> gzip on;
> gzip_disable "MSIE [1-6]\.(?!.*SV1)";
> gzip_types application/x-javascript text/css;
>
> server {
> listen 80;
> server_name mailbk.fis.unb.br;
> root /home/httpd/html;
> index index.html index.htm index.php;
>
> #charset koi8-r;
>
> #access_log logs/host.access.log main;
>
> location / {
> try_files $uri $uri/ /index.php?$args;
> }
>
> error_page 500 502 503 504 /50x.html;
> location = /50x.html {
> }
>
> location ~ \.php$ {
> fastcgi_split_path_info ^(.+\.php)(/.+)$;
> fastcgi_pass unix:/var/lib/php-fpm/php-fpm.sock;
> fastcgi_index index.php;
> fastcgi_param SCRIPT_FILENAME
> $document_root$fastcgi_script_name;
> include fastcgi_params;
> }
>
> location ~ /\.ht {
> deny all;
> }
> }
>
> # HTTPS server
> server {
> listen 443;
> server_name mailbk.fis.unb.br;
> root /home/httpd/html;
> index index.html index.htm index.php;
>
> ssl on;
> ssl_certificate /etc/pki/tls/certs/server.crt;
> ssl_certificate_key /etc/pki/tls/private/server.key;
>
> ssl_session_timeout 5m;
>
> ssl_protocols SSLv2 SSLv3 TLSv1;
> ssl_ciphers HIGH:!aNULL:!MD5;
> ssl_prefer_server_ciphers on;
>
> gzip on;
> gzip_types application/x-javascript text/css;
>
> location / {
> #try_files $uri $uri/ /rampage.php?$args;
> try_files $uri $uri/ /index.php?$args;
> }
>
> # pass the PHP scripts to FastCGI server listening on
> 127.0.0.1:9000
> #
> location ~ \.php$ {
> fastcgi_split_path_info ^(.+\.php)(/.+)$;
> fastcgi_pass unix:/var/lib/php-fpm/php-fpm.sock;
> fastcgi_index index.php;
> fastcgi_param PATH_INFO $fastcgi_path_info;
> fastcgi_param SCRIPT_FILENAME
> $document_root$fastcgi_script_name;
> fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
> include fastcgi_params;
> }
> }
>
> }
> ====== snip end ======================================
>
> ---
> Eduardo
>
> Citando Andy Dorman <adorman at ironicdesign.com>:
>
>> On 09/03/2013 10:02 AM, José Eduardo Martins wrote:
>>> Sorry, Andy. I don't know how to do this. Could you point me what I need
>>> change in Nginx/Apache config?
>>>
>>> Thanks.
>>>
>>> ---
>>> Eduardo
>>>
>>> Citando Andy Dorman <adorman at ironicdesign.com>:
>>>
>>>> On 09/03/2013 09:39 AM, José Eduardo Martins wrote:
>>>>>
>>>>> Citando Jan Schneider <jan at horde.org>:
>>>>>
>>>>>> This is better asked on a PHP mailing list.
>>>>>> --
>>>>>> Jan Schneider
>>>>>
>>>>> I change PHP log as Andy said. I get these lines about PHP ERROR in
>>>>> horde log:
>>>>>
>>>>> 2013-09-03T11:35:58-03:00 NOTICE: HORDE-5.0 [imp] PHP ERROR: Undefined
>>>>> index: delimiter [pid 14854 on line 564 of
>>>>> "/home/httpd/html/horde-5.0/imp/lib/Imap/Tree.php"]
>>>>> 2013-09-03T11:35:58-03:00 NOTICE: HORDE-5.0 [imp] PHP ERROR: Undefined
>>>>> index: delimiter [pid 14854 on line 569 of
>>>>> "/home/httpd/html/horde-5.0/imp/lib/Imap/Tree.php"]
>>>>>
>>>>> ---
>>>>> Eduardo
>>>>>
>>>>
>>>> Eduardo, about your original problem...
>>>>
>>>> If you are seeing the count of recent, unread emails in the opening
>>>> portal (which means your IMAP backend is set up correctly) but are
>>>> getting the error ("Error when communicating with the server") when
>>>> looking for the complete email list in IMP's dynamic mode, then you
>>>> may have a catchall in your Nginx (or Apache) config that stops it
>>>> from responding to the ajax request for the folder trees & list of
>>>> emails.
>>>>
>>>> That was our problem anyway.
>>>>
>>>> -- Andy Dorman
>>>>
>>>> --
>>>> Horde mailing list
>>>> Frequently Asked Questions: http://horde.org/faq/
>>>> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
>>>
>>>
>>
>> If you will post your nginx.conf & your nginx server config I will be
>> happy to take a look. Please make sure what you post is sanitized (I
>> have never seen any passwords or other "sensitive" info in an nginx
>> config, but check just to be safe)
>>
>> You should also let us know your OS, Nginx & PHP versions too.
>>
>> --
>> Andy Dorman
>>
>> --
>> Horde mailing list
>> Frequently Asked Questions: http://horde.org/faq/
>> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
>
I am NOT an Nginx nor Horde guru and I hope someone will correct me if I
am wrong...
But I think the issue is the instructions to check that the $uri file
exists as either a file or dir and if not, then automatically pass the
data to index.php.
> location / {
> try_files $uri $uri/ /index.php?$args;
> }
The Horde team actually wrote rampage.php for this specific case. So
you should actually have this for Horde...
location / {
try_files $uri $uri/ /rampage.php?$args;
}
The other difference I saw between your set up and ours was we had this
in our http (port 80) config.
location ~\.php {
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_pass unix:/var/tmp/php-fpm.socket;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
Notice the location regex and the setting of PATH_INFO & PATH_TRANSLATED
that you did not do in your http (port 80) setup (but you DID in your
https/port 443 location config)
Also, you should read this and make sure your setup is safe.
https://nealpoole.com/blog/2011/04/setting-up-php-fastcgi-and-nginx-dont-trust-the-tutorials-check-your-configuration/
Good luck.
--
Andy Dorman
More information about the horde
mailing list