草庐IT

linux命令_tree

全部标签

php - 如何在 Symfony2 应用程序的 Controller 中执行命令并在 Twig 模板中实时打印输出

我需要在我的Symfony2应用程序的Controller中执行一个持久的命令,并实时向用户返回终端的输出。我读过这个:http://symfony.com/doc/current/components/process.html#getting-real-time-process-output我不知道如何在Twig模板中实时打印终端输出。编辑:感谢Matteo的代码和用户的评论,最终实现是:/***@Route("/genera-xxx-r",name="commission_generate_r_xxx")*@Method({"GET"})*/publicfunctiongenera

php - 将 curl 命令转换为 php curl

我正在尝试将带有身份验证header的curl语句转换为phpcurl请求。但它似乎没有用,因为我收到了下面的错误echo'error:'。curl_error($ch);:error:SSLcertificateproblem:unabletogetlocalissuercertificate我的curl命令如下所示:curl--userXXXX:YYYY"URL"我的php-curl看起来像这样:$login='XXXX';$password='YYYY';$url='URL';$ch=curl_init();curl_setopt($ch,CURLOPT_URL,$url);cu

php - 如何在 Laravel 5 中获取当前使用的 Artisan 控制台命令名称?

问题/我尝试过的:在Laravel5中获取当前使用的Controller和操作很容易(但并不像它应该的那么容易),但是我坚持获取当前使用的artisan控制台命令。要获取Controller名称,我这样做:$route=Route::getRoutes()->match(Request::capture());$listAction=explode('\\',$route->getActionName());$rawAction=end($listAction);//controllernameandactioninasimplearray$controllerAndAction=ex

php - 如何在 hostgator 托管服务器 cpanel 上的 cron 作业上运行 laravel 5.2 artisan 命令?

我在Laravel5.2中创建了一个在特定时间后运行的示例计划作业。这通过artisan命令在localhost上运行良好。我在本地服务器上运行这个命令:phpartisan演示:Cron现在我将此任务添加到HostGator托管服务器上的cPanel高级选项cron作业中。但它不起作用。这是我正在尝试的命令:cd/home/pofindia/public_html/beta-var1/&&/usr/local/bin/phpartisanDemo:CronPHP版本:默认5.4。这是我的示例文件insert(['name'=>'hellonew']);$this->info('Dem

php - 之前不使用 "php"命令就无法执行 php 脚本

我需要使用不带“php”命令的php脚本。例如:$./test.php权限设置为755。这是脚本#!/usr/bin/php-q/usr/bin/php-v(所以路径存在)返回PHP7.0.15-1+deb.sury.org~xenial+1(cli)(built:Jan20201708:53:13)(NTS)Copyright(c)1997-2017ThePHPGroupZendEnginev3.0.0,Copyright(c)1998-2017ZendTechnologieswithZendOPcachev7.0.15-1+deb.sury.org~xenial+1,Copyrig

php - 加载 xdebug 时 CakePHP 命令行不工作

我正在尝试使用针对PHP7.1.6的xdebug来解决我的CakePHPv3.3.6项目中失败的单元测试。我使用以下设置设置了xdebug:[xdebug]xdebug.remote_enable=onxdebug.remote_host=127.0.0.1xdebug.remote_port=9000xdebug.remote_autostart=1xdebug.profiler_enable=offxdebug.profiler_enable_trigger=offxdebug.profiler_output_name=cachegrind.out.%t.%pxdebug.prof

PHP : different behaviour of XSLT Processor in Windows WRT to Linux

我有这个php代码段:$xsltPath=$argv[1];$xmlPath=$argv[2];$xslt=file_get_contents($xsltPath);$xml=file_get_contents($xmlPath);$templateCMSObj=new\DOMDocument();$templateCMSObj->loadXML($xslt);$ekbXMLObj=new\DOMDocument();$ekbXMLObj->loadXML($xml);$proc=new\XSLTProcessor();$proc->importStylesheet($template

php - 使用 PHP/linux 将文件合并为单个 PDF

我正在研究如何将多个PDF合并为一个PDF。我正在寻找一个尽可能可靠且强大的库。最好是可以保存书签的库。Ghostscript可以在保存书签的地方连接,但我遇到了麻烦,在一种情况下它无法生成任何output.pdf。gs-q-sPAPERSIZE=letter-dNOPAUSE-dBATCH-sDEVICE=pdfwrite-sOutputFile=output.pdfdocument1.pdfdocument2.pdfdocument3.pdfGPLGhostscript8.54:Unrecoverableerror,exitcode1GPLGhostscript8.54:ERROR

php - "zip I/O error: Permission denied"执行命令

我正在尝试使用exec命令递归压缩目录,首先,出于大纲原因,我不需要zipArchive类,但是当我传递此命令时在exec命令中我收到一条错误消息:zipI/Oerror:Permissiondenied对于这个命令:cd../../;zip-Ptemppasswordhtml/acp/backup/filename.zip-rhtml/2>&1它从位于/var/www/html/acp/config.php的脚本开始,它将在cd之后移动到www目录。./../,然后将html目录压缩,并将zip文件存入/var/www/html/acp/backup/目录。但不幸的是我得到了一个权限

php - 从命令行运行 Gearman PHP 的段错误

我将UbuntuNatty与PHP5.3.5和PECLGearman0.8.0一起使用.这是版本信息:PHP5.3.5-1ubuntu7.3withSuhosin-Patch(cli)(built:Oct13201122:20:48)Copyright(c)1997-2009ThePHPGroupZendEnginev2.3.0,Copyright(c)1998-2010ZendTechnologieswiththeionCubePHPLoaderv4.0.10,Copyright(c)2002-2011,byionCubeLtd.,andwithZendGuardLoaderv3.3