草庐IT

pthread_self

全部标签

php - 在 Ubuntu 上的 PHP+Apache2 中启用线程安全 - 使用 pthreads 从源代码编译 php

在我通过apt-get安装Apache2和PHP5后,我试图让pthreads在我的Ubuntu服务器(14.04)上运行。我的初始步骤:已安装apache2-apt-getinstallapache2使用常用模块安装php5apt-getinstallphp5libapache2-mod-php5php5-mcrypt...然后我按照本教程让pthreads运行(Usercontributedmanualonphp.net):1-GetPHPversionForthisexamplewewilluseversion:5.4.36#wgethttp://www.php.net/dist

php - PHP Pthread 类中的 Yii 框架上下文

我正在研究PHPPthreads.我写了一个继承“Thread”类的类。此类不识别Yii(1.x)框架上下文。我不能使用任何Yii框架组件或模型。我已经确保线程类应该驻留在Yii框架的可访问路径中,该路径在配置的“导入”中定义。这是我如何编写线程类的示例。basePath;}}更新:这是Yii配置中的导入器数组。'import'=>array('application.models.*','application.components.*','application.components.multithreaded-operations.*','application.componen

php - 如何使用 pthreads 重新编译 PHP7

我已经安装并正常运行php7buildwith-enable-zts(https://github.com/rlerdorf/php7dev)现在我需要添加pthreads扩展(https://github.com/krakjoe/pthreads),但出现一些错误:Infileincludedfrom/home/pthreads/php_pthreads.c:47:0:./src/copy.h:113:8:error:unknowntypename‘zend_live_range’staticzend_live_range*pthreads_copy_live(zend_live_r

php - 如何检查显示来 self 的服务器的图像的站点的 URL

是否可以跟踪直接从我的网络服务器显示图像的URL?例如。有人从我的网站复制图像的URL链接并将其显示在他的网站上。我能以某种方式获取他的网站URL吗? 最佳答案 您可以检查Apache日志-请参阅thisquestion找到他们。access.log适合这种情况。referer列可能是您正在寻找的列,请参阅here有关apache日志的更多信息。如果您只想让图像显示在您的网站上,请打开根.htacess文件,然后输入以下内容:OrderDeny,AllowDenyfromallAllowfromexample.com

php - 101 connections to self 错误

我的网站在我的共享主机帐户上一直出现故障,这是我的主机所说的:ItappearsthattheIPaddressofyoursiteisbeingblockedonthefirewallduetoyoursitecausingexcessiveconnectionstoitself."101connectionstoself"任何人都知道这是什么意思,我以前从未听说过101错误。我的网站是基于PHP/MySQL构建的。 最佳答案 既然您提到了PHP,也许您是通过http请求而不是从本地磁盘请求或包含文件?类似下面的内容会导致PHP包

php - 使用 Puppet 自动进行 Composer self 更新

我在全局安装了PHP的Composer,我正试图让Puppet自动运行Composerself更新命令。这是我的list:exec{"composerself-update":path=>'/usr/local/bin/'}以root身份手动运行“/usr/local/bin/composerself-update”是可行的,但是当puppet运行时它会生成此错误:changefromnotrunto0failed:/usr/bin/env:php:Nosuchfileordirectory我不知道为什么手动行为与Puppet行为不同。此外,我还以root身份运行Puppet。

php - 在 PHP 中使用 "this"和 "self"

Use$thistorefertothecurrentobject.Useselftorefertothecurrentclass.Inotherwords,use$this->memberfornon-staticmembers,useself::$memberforstaticmembers.http://board.phpbuilder.com/showthread.php?10354489-RESOLVED-php-class-quot-this-quot-or-quot-self-quot-keywordclassDemo{privatestatic$name;private

PHP pthreads : Difference between Threaded and Stackable

我对这两个类之间的区别感到困惑Threaded和Stackable在pthreadsPHP扩展。PHP手册页没有提到Stackable,但它存在并且许多关于pthreads的文本都提到了这个类;例如:RecyclingContextsMulti-ThreadinginPHPwithpthreadsEasypthreadsPools调用get_class_methods()显示这两个类实现相同的方法和get_parent_class()两者都返回FALSE。目前我假设Stackable是Threaded的别名。对吗? 最佳答案 $st

php - 抽象 PHP 类中的返回类型 "self"

PHP7.1我目前正在尝试创建一个抽象类来提供、定义和部分实现其子类的功能。这里我使用了以下结构:abstractclassParent{publicstaticfunctionfromDB(string$name=''){$instance=newstatic();if(!empty($name)){$instance->setName($name)->read();}return$instance;}publicabstractfunctionread();publicabstractfunctionsetName(string$name):self;}这里PHP似乎理解setNa

php - 无法加载动态库 'C:\php\ext\php_pthreads.dll'

我试图在我的php代码中加入线程,但我无法理解pthreads库,每次运行我的程序时我都会遇到这个错误:Warning:PHPStartup:Unabletoloaddynamiclibrary'C:\php\ext\php_pthreads.dll'-Thespecifiedmodulecouldnotbefound.inUnknownonline0我遵循了所需的每个步骤:I'veaddedthefilepthreadVC2.dllinmy"C:\php"folderI'veaddedthefilephp_pthreads.dllinmy"C:\php\ext"folderI'vem