Skip to content
New issue

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

unhelpfull error message when php curl not installed #10

Closed
renepickhardt opened this issue Jan 25, 2018 · 2 comments
Closed

unhelpfull error message when php curl not installed #10

renepickhardt opened this issue Jan 25, 2018 · 2 comments

Comments

@renepickhardt
Copy link

renepickhardt commented Jan 25, 2018

When php-curl ist not installed proceeding to payment yields the following error message:

Internal Server Error

The apache error log referes to php-restclient/restclient.php line 135. This call to curl should be wrapped into try catch and yield a helpfull error message. However I cannot find the referenced file in the git repo (so I could not look into the source code)

[Fri Jan 26 00:15:53.203187 2018] [:error] [pid 3167] [client ::1:36028] PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in /var/www/html/wordpress/wp-content/plugins/woocommerce-gateway-lightning/vendor/tcdent/php-restclient/restclient.php:135\nStack trace:\n#0 /var/www/html/wordpress/wp-content/plugins/woocommerce-gateway-lightning/vendor/tcdent/php-restclient/restclient.php(113): RestClient->execute('/invoice', 'POST', '{"currency":"BT...', Array)\n#1 /var/www/html/wordpress/wp-content/plugins/woocommerce-gateway-lightning/vendor/elementsproject/lightning-charge-client-php/client.php(22): RestClient->post('/invoice', '{"currency":"BT...', Array)\n#2 /var/www/html/wordpress/wp-content/plugins/woocommerce-gateway-lightning/woocommerce-gateway-lightning.php(114): LightningChargeClient->invoice(Array)\n#3 /var/www/html/wordpress/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(804): WC_Gateway_Lightning->process_payment(10)\n#4 /var/www/html/wordpress/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(986): WC_Checkout->process_order_payment(10, 'lightning' in /var/www/html/wordpress/wp-content/plugins/woocommerce-gateway-lightning/vendor/tcdent/php-restclient/restclient.php on line 135, referer: http://localhost/wordpress/index.php/checkout/

This is particular important for the people who are running on managed hosting and have no access to error logs and can't know if php curl is installed.

@shesek shesek closed this as completed in ca40a13 Jan 26, 2018
@shesek
Copy link
Contributor

shesek commented Jan 26, 2018

Thanks for the suggestion, added in ca40a13.

The error will look like that:

image

@renepickhardt
Copy link
Author

thanks for the fix. I tried to extend this a little bit for inexperienced users (which are most likely to run into this problem if they are not self hosting their site)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants