Skip to content
Advertisement

Tag: php

sudo: no tty present and no askpass program specified When useing shell_exec

I have a php page that is trying to run a service restart using: $list=shell_exec(‘sudo /sbin/service NetworkManager restart’); I needed to edit my sudoers file to let this happen. Thus: #Defaults requiretty and apache ALL=(ALL) NOPASSWD: /sbin/service When that failed, as a test I ran: apache ALL=(ALL) NOPASSWD: ALL I have run a shell_exec without the sudo command: $list=shell_exec(‘whoami’); echo

strikethrough characters on php stream output

I am using php ssh2_exec to execute a ps aux command on a remote Linux server… The server initiating the connection is Ubuntu 14.04 and the server I am communicating with is Centos 6.6. Both systems are fully updates and I am using the following versions of PHP and Apache on the Ubuntu system: apache2 2.4.7-1ubuntu4.5 libapache2-mod-php5 5.5.9+dfsg-1ubuntu4.11 php5 5.5.9+dfsg-1ubuntu4.11

debugging long running PHP script

I have php script running as a cron job, extensively using third party code. Script itself has a few thousands LOC. Basically it’s the data import / treatment script. (JSON to MySQL, but it also makes a lot of HTTP calls and some SOAP). Now, performance is downgrading with the time. When testing with a few records (around 100), performance

Check PDF number pages with PHP (in Linux)

I have a webpage where I let users to upload files to the account folder. Exactly PDF and JPG files only. I want to count the number of pages inside each PDF uploaded to show it to the users. To do this, I was using PDFINFO linux library, part of XPDF proyect. This is the man page of the binary

readdir function is not reading the whole directory on linux system

On my hosting provider i have a directory called hosts that has a structure like this the content of hosts.php file is this when i run hosts.php i get this output so php doesn’t show ma_women_com.php ! if i removed this useless line from hosts.php the output goes fine and it can read ma_women_com.php in addition if i removed on

-bash: laravel: command not found

I have installed the composer and move the composer.phar file to /usr/local/bin just follow the following step: Then I edit my ~/.bash_profile file as following: and save the change and excute: But, when I excute the laravel new test command, it returns an error: PS: in /usr/local/bin directory have no laravel command just composer command exists. Did I forgot something?

How to run php properly from the command line [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question

Advertisement