Frequently getting Error: Unexpected error while performing an AJAX call. Maybe the connection to the server is lost.

Dear Sir,

I am frequently getting error Frequently getting
Error: Unexpected error while performing an AJAX call. Maybe the connection to the server is lost.
further to that I am also getting prompt - 
You must update your .htaccess file so that the path is injected into the GET parameter __elgg_uri (you can use install/config/htaccess.dist as a guide).
If I change .htaccess permission to 644, I sometimes get the following when I run myhotfb.com/upgrade.php
https://www.myhotfb.com/permalink/default/1/myhotfbcom

Only thing that I have changed was from shell I changed to "data" folder permission to 775 (recommended by elgg) which was before, 770

Could anyone lend a hand, and tell me what is going on?

 

  • BTW, I must add that the "data" folder structure I have is as under:

    /data/ -------- 770
        |--------/2.3dataroot/ --- 775
                      |----------- all folders are set to 775, and all files are set to 644

    /data/ -------- 770
          |----/2.3cacheroot/
                     |------/system_cache/         --- 775
                     |------/views_simplecache/ ---  700

    * under /system_cache/         --- 775
                    |-------------- all files are set to 644

    * under /views_simplecache/ ---  700
                    |-------------- all folders and subfolders are set to files are set to 775
                                       all files under views_simplecache, and folders, and subfolders are set to 644

    In config file
    
    $CONFIG->dataroot = "/home/data/2.3dataroot/";
    $CONFIG->simplecache_enabled = true;
    
    //$CONFIG->boot_cache_ttl = 10;
    
    $CONFIG->cacheroot = "/home/data/2.3cacheroot/";
    
    $CONFIG->db_disable_query_cache = true;

    and .htaccess

    # Elgg htaccess directives
    
    
    # Don't allow listing directories
    
    Options -Indexes
    
    
    # Follow symbolic links
    
    Options +FollowSymLinks
    
    
    # Default handler
    
    DirectoryIndex index.php
    
    
    
    ############################
    
    # BROWSER CACHING
    
    
    # Make sure .ico has proper MIME type, allowing mod_expires to handle them.
    
    <IfModule mod_mime.c>
    
        AddType image/vnd.microsoft.icon .ico
    
    </IfModule>
    
    
    # The expires module controls the Expires and Cache-Control headers. Elgg sets
    
    # these for dynamically generated files so this is just for static files.
    
    <IfModule mod_expires.c>
    
    ExpiresActive On
    
    ExpiresDefault "access plus 1 year"
    
    </IfModule>
    
    
    # Conditional requests are controlled through Last-Modified and ETag headers.
    
    # Elgg sets these on dynamically generated cacheable files so this is just for
    
    # static files. Note: Apache sends Last-Modified by default on static files so
    
    # I don't think we need to be sending ETag for these files.
    
    <FilesMatch "\.(jpg|jpeg|gif|png|mp3|flv|mov|avi|3pg|html|htm|swf|js|css|ico)$">
    
    FileETag MTime Size
    
    </FilesMatch>
    
    
    
    ############################
    
    # PHP SETTINGS
    
    # Don't forget to keep these two IfModules in sync!
    
    #
    
    <IfModule mod_php5.c>
    
    # If using PHP 5.6
    
    
    # limit the maximum memory consumed by the php script to 64 MB
    
    php_value memory_limit 64M
    
    # post_max_size is the maximum size of ALL the data that is POST'ed to php at a time (8 MB)
    
    php_value post_max_size 32M
    
    # upload_max_filesize is the maximum size of a single uploaded file (5 MB)
    
    php_value upload_max_filesize 16M
    
    # on development servers, set to 1 to display errors. Set to 0 on production servers.
    
    php_value display_errors 0
    
    </IfModule>
    
    <IfModule mod_php7.c>
    
    # If using PHP 7.x
    
    
    # limit the maximum memory consumed by the php script to 64 MB
    
    php_value memory_limit 64M
    
    # post_max_size is the maximum size of ALL the data that is POST'ed to php at a time (8 MB)
    
    php_value post_max_size 8388608
    
    # upload_max_filesize is the maximum size of a single uploaded file (5 MB)
    
    php_value upload_max_filesize 5242880
    
    # on development servers, set to 1 to display errors. Set to 0 on production servers.
    
    php_value display_errors 0
    
    </IfModule>
    
    
    
    ############################
    
    # COMPRESSION
    
    
    # Turn on mod_gzip if available
    
    <IfModule mod_gzip.c>
    
    mod_gzip_on yes
    
    mod_gzip_dechunk yes
    
    mod_gzip_keep_workfiles No
    
    mod_gzip_minimum_file_size 1000
    
    mod_gzip_maximum_file_size 1000000
    
    mod_gzip_maximum_inmem_size 1000000
    
    mod_gzip_item_include mime ^text/.*
    
    mod_gzip_item_include mime ^application/javascript$
    
    mod_gzip_item_include mime ^application/x-javascript$
    
    # Exclude old browsers and images since IE has trouble with this
    
    mod_gzip_item_exclude reqheader "User-Agent: .*Mozilla/4\..*\["
    
    mod_gzip_item_exclude mime ^image/.*
    
    </IfModule>
    
    
    ## Apache2 deflate support if available
    
    ##
    
    ## Important note: mod_headers is required for correct functioning across proxies.
    
    ##
    
    <IfModule mod_deflate.c>
    
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript image/svg+xml
    
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    
    BrowserMatch ^Mozilla/4\.[0678] no-gzip
    
    BrowserMatch \bMSIE !no-gzip
    
    
    <IfModule mod_headers.c>
    
    Header append Vary User-Agent env=!dont-vary
    
    </IfModule>
    
    
    # The following is to disable compression for actions. The reason being is that these
    
    # may offer direct downloads which (since the initial request comes in as text/html and headers
    
    # get changed in the script) get double compressed and become unusable when downloaded by IE.
    
    SetEnvIfNoCase Request_URI action\/* no-gzip dont-vary
    
    SetEnvIfNoCase Request_URI actions\/* no-gzip dont-vary
    
    
    </IfModule>
    
    
    
    ############################
    
    # REWRITE RULES
    
    
    <IfModule mod_rewrite.c>
    
    
    RewriteEngine on
    
    
    # If Elgg is in a subdirectory on your site, you might need to add a RewriteBase line
    
    # containing the path from your site root to elgg's root. e.g. If your site is
    
    # http://example.com/ and Elgg is in http://example.com/sites/elgg/, you might need
    
    #
    
    #RewriteBase /sites/elgg/
    
    #
    
    # here, only without the # in front.
    
    #
    
    # If you're not running Elgg in a subdirectory on your site, but still getting lots
    
    # of 404 errors beyond the front page, you could instead try:
    
    #
    
    #RewriteBase /
    
    
    
    # If your users receive the message "Sorry, logging in from a different domain is not permitted"
    
    # you must make sure your login form is served from the same hostname as your site pages.
    
    # See http://learn.elgg.org/en/stable/appendix/faqs/general.html#login-token-mismatch for more info.
    
    #
    
    # If you must add RewriteRules to change hostname, add them directly below (above all the others)
    
    # Ensure # that we exclude any sub-domains
    
    
    RewriteCond %{HTTP_HOST} ^(www\.)?myhotfb.com$ [NC]
    
    RewriteCond %{HTTPS} off
    
    RewriteRule ^ https://www.myhotfb.com%{REQUEST_URI} [NC,L,R]
    
    
    # Secondly redirect all non-www to www
    
    
    RewriteCond %{HTTPS} on
    
    RewriteCond %{HTTP_HOST} !^www\.
    
    RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [NC,L,R]
    
    
    # explicity allow access for the .well-known directory
    
    RewriteRule "^.well-known/" - [L]
    
    
    # hide all dot files/dirs (.git)
    
    RewriteRule (^\.|/\.) - [F]
    
    
    # Everything else that isn't a file gets routed through Elgg
    
    RewriteCond %{REQUEST_FILENAME} !-f
    
    RewriteCond %{REQUEST_FILENAME} !-d
    
    RewriteRule ^(.*)$ index.php?__elgg_uri=$1 [QSA,L]
    
    
    </IfModule>
    
    
    

    PHP 5.6
    memory_limit  128M
    post_max_size 64M
    upload_max_filesize 32M

    **** but in .htaccess limiting so that memory doesn't get consumed by script.

    php_value memory_limit 64M
    
    # post_max_size is the maximum size of ALL the data that is POST'ed to php at a time (8 MB)
    
    php_value post_max_size 32M
    
    # upload_max_filesize is the maximum size of a single uploaded file (5 MB)
    
    php_value upload_max_filesize 16M

     

    I have my back stuck against the wall. Really need some help and any help would be highly appreciated and not to mention my utmost gratitude. 

  • Kindly please consider the followings as well.  *** IMPORTANT

    Under /data/ --- while data has 770

    I have deleted both the following folders & sub directories and files.
    2.3cacheroot
    2.3cacheroot

    From Admin Panel

    Flushed the Cache, and Ran Upgrade. then went back to data root and refreshed: I have both the  directories and subdirectories and files back with different set of permissions autogenerated by elgg file system/ or auto inherited as per unix file permission where main directory "Data" remains as 770 So, Now I have - 

    2.3cacheroot - 700
    2.3cacheroot - 750

    Should the immediate above be the correct permission? BTW, question can arise how did I ended up with permission discrepancies? It is because, when I ran the elgg install, I manually created  both the followings directories, and by default they had 755.
    2.3cacheroot
    2.3cacheroot

    then I declared the path in config file., so without touching the config file, I deleted both the directories as described above, and when flushed and upgrade is ran, I get different permissions.

    So, should i keep it as auto generated and inherited permissions?

  • 1. Try not to use [.] dots in the names of data_path and root_path

    2. Comment these lines in settings.php:

    $CONFIG->simplecache_enabled = true;
    $CONFIG->cacheroot = "/home/data/2.3cacheroot/";

    3. Use default:

    $CONFIG->db_disable_query_cache = false;

    4. Check your database' values in the table elgg_datalists:

    name 'dataroot'  value 'your_data_path'

     

    Note: renaming path names requires the changing the names in settings.php and DB.