We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Fatal error on Phalcon on doing simultaneously request - Server WAMP

I'm creating an application that on the front end will run a SPA with VueJS and in the back end a webservice with Phalcon. I'm having a problem when I make two asynchronous calls simultaneously to the API (located on my test machine) I receive the following error on the second call:

<br />
<b>Fatal error</b>:  Uncaught Error: Access to undeclared static property: 
Phalcon\Di::$_default in D:\wamp64\www\web-service\public_html\index.php:19
Stack trace:
#0 [internal function]: Phalcon\Di-&gt;__construct()
#1 D:\wamp64\www\web-service\public_html\index.php(19): 
Phalcon\Di\FactoryDefault-&gt;__construct()
#2 {main}

Next Error: Access to undeclared static property: Phalcon\Di::$_default in 
D:\wamp64\www\web-service\public_html\index.php:19
Stack trace:
#0 [internal function]: Phalcon\Di-&gt;__construct()
#1 D:\wamp64\www\web-service\public_html\index.php(19): 
Phalcon\Di\FactoryDefault-&gt;__construct()
#2 {main}
  thrown in <b>D:\wamp64\www\web-service\public_html\index.php</b> on 
line <b>19</b><br />

If I run each call after another, both work correctly.

My server run on a Windows machine with WAMP



85.5k

you are using wrong phalcon.dll or very old one, check if you miss downlaoded non-thread-safe

edited Mar '18

I check again, my SO is a Windows 7 x64, i m running a php 7.2.2 and downloaded that phalcon version phalcon_x64_vc15_php7.2.0_3.3.1.zip

The API works correctly if i call one at a time, for example:

If i call https://myapi.com/city it works. If i call https://myapi.com/state , it works. But if I try to call both at the same time with AJAX for example, one works correctly and the other shows the error

Hi @ruhan yes is very noisy but in Windows all we have the same problem, it's a unsolved bug posible solutions: disable XDebug or use Nginx

Good luck