Checkout page 500 error!

Hey Guys!

I’m having a small issue with my site at the moment. I’m trying to set up a my Woocommerce shop on my website however, whenever I try to access the checkout page I get a 500 Internal Error.

The first few things I did were:

  • Making sure Woocommerce is updated.
  • Making sure Pro is updated.
  • Deleting the Checkout page and creating a new one.
  • Making sure I use the correct shortcode and the page is recognized by Woocommerce as the checkout page.
  • Deactivating all plugins to check if there is a plugin conflict.

All these steps didn’t fix the issue. The last thing I tried was to switch the theme. So I activated the 2017 standard Wordpress theme and with that theme the checkout page is working completely fine.
This is why I assume that there is some sort of issue with the Pro theme or at least with my installation of the theme.

It would be awesome if you guys could help me out ! :slight_smile:

Regards,
Oguzhan

PS:
If you want to check out the issue yourself you can click on the link below to add an item to the cart of my page.
https://stiickzz.pro/cart/?add-to-cart=698
Then simply press on the checkout button or visit this link: https://stiickzz.pro/checkout/

1 Like

Hi there @StiickzZ,

Thanks for writing in!

As this is an internal server error, there will be a fatal error most likely in your server error log. As you host with HostGator, please follow this tutorial http://support.hostgator.com/articles/cpanel/internal-server-error-help-500-error?utm_source=externalerror&utm_medium=hgsuspage&utm_campaign=client500 to access your server error log and let us know of any issues that show up.

Thanks!

Hi Jack,

This is the last error in the log file:

[27-Oct-2017 10:21:01 America/Chicago] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set ‘always_populate_raw_post_data’ to ‘-1’ in php.ini and use the php://input stream instead. in Unknown on line 0

I’ve also been talking to the Hostgator support to try and see if they can help.
They told me the issue is caused by the Woo Checkout Editor plugin which comes with Pro. However, deactivating, deleting and reinstalling the plugin didn’t help at all. The guy also told me that he thinks that plugin is causing the issue because after deactivating all plugins the issue disappeared however, he also deactivated woocommerce. After activating woocommerce again the issue still remains.
I personally am not too convinced that that plugin is causing the issue but I still thought I’d let you guys know about my conversation with that support as it may help you to solve this issue.

Hi there.

Unfortunately at the moment I wanted to check the case the Woocomemrce is deactivated and I only saw the shortcode.

I suggest that you make sure you have the compatible version of the Woocommerce with our theme. You can test that here:

If you still encounter problems after making sure that you have a compatible version, kindly get back to us with the URL/User/Pass of your website using the Secure Note functionality of the theme to follow up the case.

Thank you.

Hey!

As mentioned in my first message. I did make sure that everything is updated.
I’ll leave you with my login credentials.

Yes, the plugins are not the cause of the issue because I just tried it myself. I left WooCommerce the only activated plugin but the issue persists. Would you mind trying the following solutions.

  • Increase your memory by adding this to your wp-config.php
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
  • Remove Endurance Cache. Contact your host regarding this

If nothing helps, please give us cPanel / FTP access.

Thanks.

I’ve added the code you provided to the wp-config.php. Unfortunately it didn’t help.
I already tried removing Endurance Cache once but it didn’t help either. Just to be sure I deleted it again.
The issue was also already there before I installed WP Rocket so I doubt that that plugin is causing any issues.
I’ve also tried to rest my .htaccess multiple times without any luck.

I haven’t tried reinstalling WordPress yet. Before I do that I would like to know if I could loose certain data by doing that. Like Pages, Posts etc.

I will also leave you guys the access to the cPanel.

Thanks a lot for trying to help guys! I really appreciate it :slight_smile:

I’ve reset your htaccess and your checkout now works.

There are htaccess rules added by WP Rocket and I also see a custom rule. If you encounter this issue again, please contact your host or hire a server admin to setup them up correctly.

This wasn’t a theme issue. I understand you switched to the default theme and it worked most probably because of caching being cleared or something reset in WordPress during the theme switch. But, the original cause is the custom htaccess rules.

Thanks.

Hey @christian_y,

You are on the wrong website. The website containing the issue is www.stiickzz.pro not www.stiickzz.com. Please look at the links I provided on my initial post.
The cPanel as well as Wordpress login credentials I provided were for the site stiickzz.pro as well so if so far you guys changed something it still didn’t fix it :confused:

Hello There,

Thanks for updating in! I am another staff checking in your site. There is something going on with your checkout page. I do not know what it is. I already did the following:
1.) I edited the error 500.shtml in your server and as soon as I check the checkout page, it is still displaying the same error page with out my changes in it.

2.) I created an X test page and used it as the Check out page. It just works with the [woocommerce_checkout] shortcode in it. It just works like this:

Here’s what I want you to do:
1.) Please edit your check out page in Cornerstone and save it as a block or page template.
2.) Delete your check out page.
3.) Please make sure that in your page trash (https://stiickzz.pro/wp-admin/edit.php?post_status=trash&post_type=page) it is also deleted.
4.) Create a new page Check Out and use the simple [woocommerce_checkout] shortcode first and test it.
5.) Once it displays, you can re edit it again and make use of the previously saved template and do another round of test.

Please let us know how it goes.

Hi @RueNel !

Thanks a lot for having a look into this issue.
Unfortunately deleting the page and just inserting the shortcode didn’t work. As soon as I implement the checkout shortcode into the page, it is broken. If I take it out again it works completely fine.
Inside of the Pro page editor the checkout page layout loads completely fine, however as soon as you want to access the page directly, you get the error again.

I’ve done some further testing and tried to implement the shortcode in various ways. I tried implementing it using the Text, Content Area, Classic Text and Classic Raw Content element. With all of those elements I still get the error.
The only difference I noticed is that when you use the brand new Content Area element, Woocommerce doesn’t register that the shortcode was implemented on the site. So if you go to the Woocommerce status under ‘WC Pages’, for Checkout it says ’ Page ID is set, but the page does not exist’ although the shortcode was implemented.
That doesn’t really have anything to do with the issue, because if I use the classice raw content element woocommerce properly registers that I successfully implemented the shortcode, yet I still get the same error.
I just thought I should mention this as this might be something you guys want to fix in the future.

Besides trying to implement the shortcode with different elements in the Pro edtior I’ve also tried to implement it through the standard Wordpress Text editor. So what I did was, I deleted the checkout page, created a new one and inserted the shortcode in the Text editor. After doing that the checkout page loads properly and works fine. As soon as I press on the ‘Edit with Pro’ button and save the page through the Pro editor. The page is broken again. Even if I go back to the text Editor and try to re-save it from there.

This makes me believe that the issue might not necessarily be the Pro theme itself, but rather just an issue between the Pro Editor and that Checkout shortcode. As mentioned in my first post, as soon as I switch the entire theme, the checkout page works perfectly fine. I don’t have too much knowledge about code but I do assume that when I switch the theme off it also turns off the Pro Editor, and with the checkout page working when I insert the shortcode through the standard Text editor even if the Pro theme is active, really makes me believe that the issue might just be the Pro editor.

I hope this little research helps in some way to fix this issue.
I really do appreciate you guys trying to help me out! :slight_smile:

Hi there,

Please check it again. You should let Woocommerce create the pages it needs. Under Woocommerce > Status, there is Create Pages button, I went ahead and created them.

You’re getting page no ID message is because the pages aren’t created yet.

Plus, I ddn’t get the 500 error while Checkout Editor plugin is active. And please don’t edit the checkout page, let it be the default display. Maybe Woocommerce has a different way of handling it especially the templates.

Thanks!

Sorry about that. I checked again and I did not experience the 500 error but instead clicking checkout redirects back to the home page. So I deleted the page with the checkout shortcode then went to WooCommerce > Settings > Checkout and set your Checkout as WC Checkout page. And, I get this https://youtu.be/wQT-s821oMM. The issue is not 500 error anymore but the layout. I’m not sure why it’s full width. I tried restoring your previous htaccess but it made no difference. The last error log I see is this:

[28-Oct-2017 09:03:41 America/Chicago] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0

Could you try setting up another staging server with just Pro and WooCommerce to see if this also happens and if it doesn’t, we’ll have a setup to compare to.

Hey @Rad

I haven’t let Woocommerce create any of it’s pages automatically. As long as you manually insert the Shortcode somewhere on your website, Woocommerce recognizes that page and under status will give it the proper page ID.
But if you use the new Content Area element to insert the Shortcode, Woocommerce can’t seem to automatically find the Shortcode anywehre on the site.
But that isn’t even the issue. As I said, I just htought I’d mention this as this might be something to fix in the future.

@christian_y
The reason why the 500 error disappeared and the Checkout page is now full width is because as mentioned in my last post, I inserted the checkout Shortcode through the standard WordPress Text editor instead of using the Pro editor.
That’s why I mentioned that I believe that the issue might not be the theme but rather just the Pro editor.
I’ve now inserted the code again through the Pro editor, the same way I inserted the Cart shortcode, My Account shortcode etc. And now we’re once again back with the 500 error.

Hi,

I tried exact same settings in my test sites but did not get an error 500.

Woocommerce version 2.3.2
Woo Checkout Editor Vesion 2.0.1
Added woo checkout shortcode in PRO Editor

There is something in your site that is preventing it from working.

Can you create a staging site so we can freely debug and test without causing any issue to your live site.

Thanks

You guys can feel free to do all sorts of testing on the site right now. It’s not an actual live site yet and has no visitors.

Hello There,

I have spent several hours looking into this issue. No matter what I do, I could not find the error log. This file should be found somewhere and holds the key to what the cause of the error 500 in your check out. I have check the theme files, php settings, htaccess and even used default theme. The only time error 500 will appear is if it renders the [woocommerce_checkout] shortcode. I am not sure if this is because of the theme function or what so ever. Maybe it’s time we ask assistance from your hosting provider to locate the error log file. I have checked your the log files I could find and not of those displays the current date. Maybe you could ask them about this error 500 on the checkout page and ask for advise where we can find the error log or somewhow they can give us the error messages for the page.

Hoping to get a reply soon.

Thanks for taking the time to investigate this issue @RueNel

I’ve contacted my hosting support already before I even created this post here. I’ve spend multiple hours with different support members and even tier 2 support members. All of them couldn’t fix this issue.
Simply because the issue disappears once I select another theme and not the Pro theme, I always got advised to contact you guys here as they assumed that it’s an issue with the theme and not an issue with the servers.

This issue is slowly driving me crazy… it’s been 2-3 weeks already since I wanted to launch that site but I’m not able to due to this annoying issue :confused:
Right now it seems like the only way to fix this would be to switch to another theme but I personally really love the Pro theme which is why I hope that you guys can help me fix this asap.

Hi there,

You mean another has content area element too and when you switch the theme it works? Woocommerce checkout shortcode is supposed to be added alone in the editor and not with the builder for the reason that it’s the hook to let Woocommerce that it’s one of its default pages.

The issue here is not the theme or server, but the combination of shortcodes and it usually happens in Wordpress. Let’s take this a sample,

add_filter('the_content', 'share_me');

function share_me ( $content ) {

return $content.do_shortcode('blah bla blah ..... so on');

}

This could actually cause internal server error since it can create loops. The the_content itself has do_shortcode() and you’re calling another do_shortcode() within it.

In the builder, all element with text processing as do_shortcode() to allow shortcode processing within the content, all editor are supposed to have do_shortcode(), else, your added shortcode will not be executed.

Now, [woocommerce_checkout] has many filters and hooks, and internal shortcodes as well. Calling it with content is the element or any text element will result in 500 internal server error.

Then we have 3 options

  1. When you said fix it on the builder side, then remove do_shortcode in all type of text element, but doing that will remove the shortcode capability of the editor (example, [acf field="name"] will stay [acf field="name"] instead of displaying the value of that shortcode.

  2. Remove the filter, hooks, and internal shortcodes or Woocommerce’s [woocommerce_checkout] but that will kill the real purpose of the checkout page

  3. Don’t use the builder in Woocommerce’s default pages.

BUT these are just assuming that the issue is related to the builder and [woocommerce_checkout] since your reply to me and Christian is a bit confusing:

As long as you manually insert the Shortcode somewhere on your website, Woocommerce recognizes that page and under status will give it the proper page ID.
But if you use the new Content Area element to insert the Shortcode, Woocommerce can’t seem to automatically find the Shortcode anywehre on the site.

  • Does that mean it works in PRO (no 500 internal server error ) and just can’t recognize the shortcode, then you said:

The reason why the 500 error disappeared and the Checkout page is now full width is because as mentioned in my last post, I inserted the checkout Shortcode through the standard WordPress Text editor instead of using the Pro editor.

I checked again your woocommerce’s checkout pages and I’m not getting any 500 internal server error. But, I’ll continue checking.

Thanks!

1 Like