Codexshaper / laravel-woocommerce

WooCommerce Rest API for Laravel
MIT License
189 stars 59 forks source link

cURL Error: Operation timed out after 15000 milliseconds with 0 bytes received #69

Open kantsverma opened 3 years ago

kantsverma commented 3 years ago

Getting these issues on the server after deploying the code. It's working fine in localhost.

Even I am adding the dummy products ie

$data = [
            'name' => 'TBI Test Product',
            'type' => 'simple',
            'regular_price' => '10.00',
            'description' => 'Simple product full description.',
            'short_description' => 'Simple product short description.',
            'categories' => [
                [
                    'id' => 1
                ]
            ],
            'images' => [
                [
                    'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg'
                ],
                [
                    'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg'
                ]
            ]
        ];

        $product = Product::create($data);


**Complete error is:**

message: "cURL Error: Operation timed out after 15001 milliseconds with 0 bytes received",…}
exception: "Exception"
file: "/home/development/public_html/project/vendor/codexshaper/laravel-woocommerce/src/Traits/WooCommerceTrait.php"
line: 63
message: "cURL Error: Operation timed out after 15001 milliseconds with 0 bytes received"
trace: [{,…}, {,…}, {,…}, {,…},…]
maab16 commented 3 years ago

Hello @kantsverma,

I think it's WordPress related issue. Please check your store server and you can increase the PHP memory limit and execution time

You can use ini_set in runtime.

ini_set('memory_limit', '-1'); // Unlimited
ini_set('max_execution_time', '0'); //Unlimited

After execution script then reset default memory_limit and execution.

kantsverma commented 3 years ago

@maab16 yes i resolved it thank you for the response.

maab16 commented 3 years ago

You can share the solution how you solve this problem so that other guys don't waste their time.

Here we are all help each other. Thanks. 🙂

On Sat 17 Apr, 2021, 12:24 PM Kantsverma, @.***> wrote:

@maab16 https://github.com/maab16 yes i resolved it thank you for the response.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Codexshaper/laravel-woocommerce/issues/69#issuecomment-821775503, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE66J2RNUOPVJXHNAJPVMSLTJESQXANCNFSM42Q5LKZQ .

kantsverma commented 3 years ago

@maab16 Yes sure I was sending the wrong parameters of the Product image. All the parameters should be perfect even the product image URL should be propper image URL that Woocomerce can copy to the WP upload folder as a product image.