appstract / laravel-opcache

Laravel Package for OPcache
MIT License
1.33k stars 118 forks source link

curl_setopt_array(): CURLOPT_DNS_USE_GLOBAL_CACHE cannot be activated when thread safety is enabled #66

Closed pagnax closed 6 years ago

pagnax commented 6 years ago

I have the following problem when trying to run command php artisan opcahce:clear in laravel 5.5. Please help me to solve this problem.

In Curl.php line 32:

curl_setopt_array(): CURLOPT_DNS_USE_GLOBAL_CACHE cannot be activated when thread safety is enabled

teuunn commented 6 years ago

Hi @pagnax,

Please provide us some more information.

Ps. I hope the typo in the command is accidentally came into the issue?

pagnax commented 6 years ago

Hi @teuunn ,

I am currently using wamp 3.0.6 64 bit, php 7.1.9. I run on window 7 ultimate 64 bit

After I install laravel-opcache and try to run command php artisan opcache:clear in laravel 5.5, it produce the following error:

In Curl.php line 32: curl_setopt_array(): CURLOPT_DNS_USE_GLOBAL_CACHE cannot be activated when thread safety is enabled

teuunn commented 6 years ago

I don't have experience with wamp, but maybe it has something to do with the old safe_mode turned on?

pagnax commented 6 years ago

Is there solution to fix this problem? or do you have any recommend for this problem?

teuunn commented 6 years ago

If we know what the problem is then we can look for the solution. If safe_mode in wamp is set to on, change it to off to see if that's the fix.

pagnax commented 6 years ago

There is no line safe_mode in php7.1. So I added safe_mode=off in php.ini but it still show the same error.

pagnax commented 6 years ago

this is my opcache.php '<?php

return [ 'url' => env('OPCACHE_URL', config('app.url')), 'verify_ssl' => true, 'directories' => [ base_path('app'), base_path('Modules'), base_path('bootstrap'), base_path('public'), base_path('resources/lang'), base_path('routes'), base_path('storage/framework/views'), base_path('vendor/appstract'), base_path('vendor/composer'), base_path('vendor/laravel/framework'), ], ];'

and this is my .env file ' APP_NAME='blue hcm' APP_ENV=local APP_DEBUG=true APP_LOG_LEVEL=debug APP_URL=http://laracon.hcm.com OPCACHE_URL=http://laracon.hcm.com

BROADCAST_DRIVER=log CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379

MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME= MAIL_PASSWORD= MAIL_ENCRYPTION=tls

PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET= '

ovanschie commented 6 years ago

@pagnax If you try to clear opcache of your site, run the command on your server and not on your local machine

ovanschie commented 6 years ago

@pagnax and don't post sensitive .env variables!

pagnax commented 6 years ago

@ovanschie server and my site are in the same machine.

ovanschie commented 6 years ago

@pagnax can you try to update lush-http to 0.5.3 (composer update should be enough)

pagnax commented 6 years ago

@ovanschie it works perfectly now after update lush-http to 5.0.3.

Thank you so much for your support.