I know that PHP is not multithreaded, but I talked with a friend about this: if I have a big algorithmic problem that I want to solve with PHP, this is not just a solution using the curl_multi_xxx interface and running n HTTP requests on the same server. This is what I would call a multi-threaded PHP style.
Is there a problem with this in a typical web server environment? The main request waiting for "curl_multi_exec" should not count the time from the maximum duration or memory length.
I have never seen this go anywhere as a solution to prevent a script killed by too strict admin settings for PHP.
If I add this as a function to the popular PHP system, will server administrators hire a Russian mafia to avenge this hack?
If I add this as a function to the popular PHP system will server administrators hire the Russian mafia hitman to avenge this hack?
No, but this is still a terrible idea, since only PHP should render web pages. Do not run large algorithms. I see that people are always trying to do this in ASP.Net. There are two correct solutions.
curl, - . , .
PHP forking (pcntl_fork). , - pcntl_waitpid. "" , . , , , , , , . . forking 50 .
PHP forking, , Spencer. , , script. , .
exec("nohup /path/to/php.script > /dev/null 2>&1 & echo $!", $output); $pid = $output[0];
exec(), , -, .
- " ", ?
, Amazon EC2, , .
: " ". , , "". , .
,
, php , concorrent, , , , . , imo, , php:)
Source: https://habr.com/ru/post/1717264/More articles:problem with compiling C ++ - c ++Adding a column programmatically to a SQL Server database - c #IE6 crashes cached design - htmlUsing Hibernate sequence generators manually - javaSQL ΡΡΠ»ΠΎΠ²Π½ΡΠΉ Π±ΠΈΡ - sqlgzdeflate () and a lot of data - phpWPF: NavigationService NULL after visiting page 2 - wpfDefine a HOST Domain Name in django Models - djangoDoes the Google App Engine support app-engine-patch support via ADMINS email after 500 errors? - google-app-engineIs it possible to authenticate using OAuth without asking a user when we have user credentials? - oauthAll Articles