A
A
Alexey Bespalov2014-01-23 18:41:23
PHP
Alexey Bespalov, 2014-01-23 18:41:23

AJAX not working under Apache2?

AJAX does not work under Apache2. Status code: 0, status: failed. I can't figure out what the problem is. On other sites on the same server, everything works as it should. The request is not cross-domain, of the form
url: '/ajax/do/delete'
Here is the site config:

<VirtualHost *:80>
        ServerName site.com
        DocumentRoot /var/www/site.com
        <Directory /var/www/site.com/>
                Options Indexes FollowSymLinks
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Bespalov, 2014-01-24
@nulldef

Found a reason. Sorry for my inattention. AdBlock just blocked all my requests. After turning it off, everything worked. Thank you all for your response.

V
Vladimir Shishmintsev, 2014-01-24
@Pingvi

AJAX is a normal request, the main difference is only in the headers sent to the server ($_SERVER["HTTP_X_REQUESTED_WITH"]).
Get Firefox+Firebug (Network tab) or another tool and browser. Send a request and see what comes up there. Most likely you have an error in the code, and some kind of exception is thrown along with the response.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question