Contact Form 7 cause HTTP 500 error

2020-07-11 07:42发布

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]

4条回答
仙女界的扛把子
2楼-- · 2020-07-11 07:53

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.

查看更多
forever°为你锁心
3楼-- · 2020-07-11 07:57

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.

查看更多
ゆ 、 Hurt°
4楼-- · 2020-07-11 08:05

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
查看更多
爱情/是我丢掉的垃圾
5楼-- · 2020-07-11 08:17

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' );
}
查看更多
登录 后发表回答