PHP Built-In Server Can't cURL -


i have relatively simple script following:

<?php $url = "localhost:2222/test.html";  echo "*** url ***\n"; echo $url . "\n"; echo "***********\n"; echo "** whoami *\n"; echo exec('whoami'); echo "* output **\n";  $ch = curl_init();   curl_setopt($ch, curlopt_url, $url);  curl_setopt($ch, curlopt_returntransfer, 1);   $output = curl_exec($ch);   curl_close($ch);  echo $output; 

when execute on command line, works - meager results within test.html.

when run script loading built-in php server , browsing script, hangs. no output screen, nothing written logs.

i read user permissions can in way, tried doing whoami ensure user ran built-in php server same 1 executed script on command line; are.

safe_mode off, disable_functions set nothing. can exec other commands (like whoami).

what else should check for? built-in php server count other user when fulfills request perhaps?

to make comment answer: php built-in development web server simple single threaded test server. cannot handle 2 requests @ once. you're trying retrieve file in separate request, you're running deadlock. first request waiting second complete, second request cannot handled while first still running.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -