Ошибка 500 ajax php

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with admin-ajax.php 500 internal error #8889

Problems with admin-ajax.php 500 internal error #8889

Comments

Hello,
Since the new version 2.4, I’m having problems in one computer (which is very strange), that does not load the media Library and Variations (modules with ajax). I’ve updated every plugin and WordPress 4.3 but it does not solve it. It has to be related with Woocommerce, because when I deactivate it, it does not have any problem.

This is the error message in Console:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,plupload&ver=4.3:5 POST https://equitienda.es/wp-admin/admin-ajax.php
500 (Internal Server Error)send @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,plupload&ver=4.3:5m.extend.ajax @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,plupload&ver=4.3:5j @ load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,underscore,shortcode,backbone,wp-util,wp-b…:376(anonymous function) @ load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,underscore,shortcode,backbone,wp-util,wp-b…:376

Читайте также:  Настройка сессии PHP

The text was updated successfully, but these errors were encountered:

Yes Mike, you are right. It was a very strange error. Seeing the logs from WordPress I found this:
[19-Aug-2015 10:52:30 UTC] PHP Strict Standards: Declaration of WC_Product_Bundle::get_price_suffix() should be compatible with WC_Product::get_price_suffix($price = », $qty = 1) in /home/equitienda/domains/equitienda.es/public_html/wp-content/plugins/woocommerce-product-bundles/includes/class-wc-product-bundle.php on line 1252

I’ve updated this plugin and it has solved. Thanks.

I am new here, working on one of my wordpress site, all the plugins and themes are updated to the latest. also i enhanced the memory to 64MB. but the issue is still there.

500 Internal Server Error
jquery. =1.12.4 (line 3180)
«NetworkError: 500 Internal Server Error — http://www.cromalam.com/product/wp-admin/admin-ajax.php»

error

Here is the attached error.

I also tried, to remove this plugin and others but the issue is same.

Look at the php error logs.

Thanks mike i found some error :

Here are they, i am trying to resolving them,

[23-Jun-2017 10:53:40 UTC] PHP Notice: woocommerce_get_page_id is deprecated since version 3.0! Use wc_get_page_id instead. in /public_html/product/wp-includes/functions.php on line 3831
[23-Jun-2017 10:55:05 UTC] PHP Notice: woocommerce_get_page_id is deprecated since version 3.0! Use wc_get_page_id instead. in /public_html/product/wp-includes/functions.php on line 3831
[23-Jun-2017 10:55:21 UTC] PHP Notice: woocommerce_get_page_id is deprecated since version 3.0! Use wc_get_page_id instead. in public_html/product/wp-includes/functions.php on line 3831
[24-Jun-2017 05:32:43 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 196608 bytes) in public_html/product/wp-includes/SimplePie/Misc.php on line 843 [24-Jun-2017 05:32:43 UTC] WP_Community_Events::maybe_log_events_response: Valid response received. Details: >,»response_code»:200,»response_body»:,»events»:»3 events trimmed.»>>
[24-Jun-2017 05:37:16 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 242538 bytes) in public_html/product/wp-includes/Requests/Transport/cURL.php on line 484
[24-Jun-2017 05:38:40 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 12288 bytes) in public_html/product/wp-includes/Requests/IRI.php on line 599
[24-Jun-2017 05:39:31 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 49152 bytes) in /public_html/product/wp-content/plugins/error-log-monitor/Elm/DashboardWidget.php on line 409
[24-Jun-2017 05:41:37 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 49152 bytes) in public_html/product/wp-content/plugins/error-log-monitor/Elm/DashboardWidget.php on line 409
[24-Jun-2017 05:46:15 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 49152 bytes) in public_html/product/wp-content/plugins/error-log-monitor/Elm/DashboardWidget.php on line 409

Thanks Mike it resolved its just the memory error.

enabled it to : define( ‘WP_MEMORY_LIMIT’, ‘256M’ );

erreure

Bonjour
quelqu’un peut m’aider sur mon erreure?? je suis nouvelle sur wordpress. je suis rester 2jours sans toucher a ma plateforme et quand j’ai voulu ajouter un produit la page se charge et ne me renvois aucun produit

et en mode console on me dit que »
load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-draggable,jquery-ui-slider,jquery-tou&load[]=ch-punch,iris,wp-color-picker&ver=4.8.4:4 POST https://www.sendeal.sn/wp-admin/admin-ajax.php 500 ()

[edited — start learning manners]

can someone help me on my mistake ?? I am new to wordpress. I stay 2 days without touching my platform and when I wanted to add a product the page loads and does not send me any product

You’d need to look in your server error logs if possible, or try WooCommerce > Status > Logs and see if fatal errors are logged there.

Источник

Почему при попытке отправить ajax запрос на сервер методом post выскакивает ошибка 500 Internal Server Error?

Я из базы достаю записи определенного пользователя. При желании пользователь может оставить комментарий к записи. Есть кнопка «Добавить комментарий», при нажатии на которую вываливается textarea с кнопкой «Добавить». Вот все это хочу сделать ajaxom. Текст из textarea я получаю, но все это дело в бд не попадает.

$('.comment').click(function()< var id_advert = $(this).val(); //console.log(id_advert); $(this).html(" 
"); $.get('edit_advert',,function() < $('.add').click(function()< var params = $('.add_comment').serialize(); console.log(params); console.log($.post('add_comment',params)); >); >); >);

Вот метод, который должен все это обрабатывать:

public function edit_advert(Request $request) < $id_advert = $_GET['comment']; $id_client = Auth::user()->id; $comment = $request->input('add_comment'); Adverts::add_comment($comment,$id_client,$id_advert); >
 @foreach ($remember_adverts_client as $advert) Объявление добавлено date>> 
title>>
Тип недвижимости: type>>
Количество комнат: quantity_room>>
Город: city>>
Описание: description>>
Телефон: phone>>
--> --> @endforeach
Route::get('edit_advert','ClientController@edit_advert'); Route::post('add_comment','ClientController@edit_advert')

В чем может быть проблема?

Оценить 5 комментариев

Источник

AJAX Call to PHP script gives me 500 Internal Server Error?

I use firebug to tell me what’s going on and it tells me that a 500 internal server error has occurred? Here is part of the script concerned:

$videoid = $_GET['videoid']; $get = new youtubeAPI(); $get->getVideoAPI($videoid); class youtubeAPI extends Exception < function getVideoAPI($videoid)< if (isset($videoid)) < $clientLibraryPath = 'library'; $oldPath = set_include_path( get_include_path() . PATH_SEPARATOR . $clientLibraryPath ); require_once 'Zend/Loader.php'; // the Zend dir must be in your include_path 

I use the same AJAX call to other scripts and they are fine. I have used these scripts on another server and it was fine except on the other server the file is named "getvideo.php5" whereas here I named it "getvideo.php" since I have PHP 5.2.6 installed only. Please help

UPDATE

[Wed Feb 11 20:48:17 2009] [error] [client xx.xx.xxx.xxx] PHP Fatal error: Class 'DOMDocument' not found in /var/www/html/library/Zend/Gdata/App.php on line 734, referer: http://xx.xx.xx.xxx/
public static function importString($string, $className='Zend_Gdata_App_Feed') < // Load the feed as an XML DOMDocument object @ini_set('track_errors', 1); $doc = new DOMDocument(); // LINE 734 $success = @$doc->loadXML($string); @ini_restore('track_errors'); 

But I shouldn't be playing around with that right? In any case, that class doesn't exist as a script and doesn't exist in that script as a class. I AM MAKING USE OF THIS SAME LIBRARY IN MY OTHER SERVER. It is also missing that too. This is what I downloaded from the Youtube API zip folder.

SOLVED

This was a brand new server and it had minimal PHP installed. I was missing PHP dom functions. A quick install fixed this problem. Thanks for reminding me to look at the logs. I should have tried that first.

yum install php-xml yum install php-xmlrpc 

Источник

Ajax post request in laravel 5 return error 500 (Internal Server Error)

While this question exists for a while, but no accepted answer is given I'd like to point you towards the solution. Because you're sending with ajax, and presumably still use the CSRF middleware, you need to provide an additional header with your request.

And add to your javascript-file (or section within the page):

90% of the laravel ajax internal server error is due to missing CSRF token. other reasons can inlucde:

  • Wrong Request Type (e.g sending post to get)
  • Wrong data type recived (e.g ajax is expecting JSON and app returns string)
  • Your .htaccess is misconfigured
  • Missing Route
  • Code Error

I guess this has been solved by now but still the best thing to do here is to send the token with your form

$("#try").click(function()< var url = $(this).attr("data-link"); $.ajax(< url: "test", type:"POST", data: < '_token': token, 'someOtherData': someOtherData >, success:function(data)< alert(data); >,error:function() < alert("error. "); >>); //end of ajax >); 

You can add your URLs to VerifyCsrfToken.php middleware. The URLs will be excluded from CSRF verification.

protected $except = [ "your url", "your url/abc" ]; 

In App\Http\Middleware\VerifyCsrfToken.php you could try updating the file to something like:

class VerifyCsrfToken extends BaseVerifier < private $openRoutes = [ . excluded routes ]; public function handle($request, Closure $next) < foreach($this->openRoutes as $route) < if ($request->is($route)) < return $next($request); >> return parent::handle($request, $next); > >; 

This allows you to explicitly bypass specific routes that you do not want verified without disabling csrf validation globally.

Laravel 7.X In bootstrap.js, in axios related code, add:

window.axios.defaults.headers.common['X-CSRF-TOKEN'] = $('meta[name="csrf-token"]').attr('content'); 

Solved lot of unexplained 500 ajax errors. Of course it's for those who use axios

By default Laravel comes with CSRF middleware.

  1. Send token in you request
  2. Disable CSRF middleware (not recomended): in app\Http\Kernel.php remove VerifyCsrfToken from $middleware array

for me this error cause of different stuff. i have two ajax call in my page. first one for save comment and another one for save like. in my routes.php i had this:

Route::post('posts/show','PostController@save_comment'); Route::post('posts/show','PostController@save_like'); 

and i got 500 internal server error for my save like ajax call. so i change second line http request type to PUT and error goes away. you can use PATCH too. maybe it helps.

Источник

Оцените статью