Rushil K. Pachchigar
Rushil K. Pachchigar

Reputation: 1321

Contact Form 7 cause HTTP 500 error

No one is able to submit forms, I took a look at it and I’m getting a POST 500 Internal Server Error.

POST http://carlsbad4rent.com/wp-json/contact-form-7/v1/contact-forms/321/feedback 500 (Internal Server Error)

enter image description here

Note: The same code is working well in localhost[wamp]

Upvotes: 11

Views: 31976

Answers (7)

Ranjith Kadamboor
Ranjith Kadamboor

Reputation: 66

I had a problem with the "Contact Form DB" plugin. When I uninstalled the plugin contact form started working fine.

Uninstall any plugin which is associated with contact form 7 and test the contact form.

Upvotes: 2

MadhuKA
MadhuKA

Reputation: 1

For me it was because I had [_date] in my php code. The code worked well until recently. Changed it to [date] and it started working again.

Upvotes: 0

J Mathenge
J Mathenge

Reputation: 101

I had the same Error and despite all the fixes proposed above none worked.

I had to downgrade fromm PHP 8.0 to 7.4

This is now working well

Upvotes: 0

Lazarus-CG
Lazarus-CG

Reputation: 96

I had a similar problem, it turned out that the error was being caused by ModSecurity installed on the cpanel. Disabling ModSecurity did the trick for me. In my research, I came across similar problems that were caused by security modules on their servers like this case that was caused by All in One Security and Firewall.

Upvotes: 3

UXguy
UXguy

Reputation: 1

Had a 500 Status Code as well when submitting my Contact Form 7. Somehow the file "class-phpmailer.php" in "wp-includes" had a filepermission of "0". I have no idea why. But i fixed this issue by changing the files permission to 0644 and now my Contact Form 7 works well, again.

Upvotes: 0

Charlieman
Charlieman

Reputation: 1

I had this same problem - turned out it was related to the Polylang plugin I was using, in particular how I was registering strings to be translated.

A quick way to test is to disable your theme / enable the default theme and if Contact Form works, it's most likely to be a problem in the theme Functions file.

For me, the fix was setting the Polylang translations in functions.php like so:

if (function_exists("pll_register_string")) {
    pll_register_string( 'name', 'Translated string' );
}

Upvotes: 0

Gaurang Sondagar
Gaurang Sondagar

Reputation: 834

You need change in .htaccess file and in local setup folder name set as "wordpress" but in live site we have to change this name.

Before

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /agilitycards/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /agilitycards/index.php [L]
</IfModule>

# END WordPress

You need to replace with below code in .htaccess file.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Upvotes: 7

Related Questions