Questions tagged [php-cli]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
2k views

How to enable/disable PHP extension for PHP CLI if there is no loaded configuration file?

I just executed php -i | grep "Loaded Configuration File" to find out where the configuration file of my PHP CLI is stored, but I get: Loaded Configuration File => (none). So it loads the ...
0
votes
1answer
145 views

Where to give index.php properly?

I have /var/www/html/moodle as my website directory. When in mysite.conf the settings are as follows: DocumentRoot /var/www/html DirectoryIndex "index.php" mysite.com gives an Index of/ page since ...
1
vote
1answer
425 views

/usr/bin/php vs /bin/php vs php in bash [closed]

We are running a php client command. php xx yy zz run just fine but not its counter parts (/usr/bin/php and /bin/php) which give very weird error. I am so confused row, given that : command -v php |...
0
votes
1answer
40 views

Permission error from Supervisor when full PHP path not specified

I've compiled PHP from source on Debian Stretch in a docker container. I have added this entry to my Supervisor config: command=/bin/sh -c 'QUEUE=orders/create APP_INCLUDE=/var/www/html/jobs/...
1
vote
0answers
61 views

Set SERVER vars programatically from the CLI

I need a script to set the SERVER variables programatically when executing a PHP script from the CLI. The idea is to get the SetEnv lines from an apache config file and feed them into the cli ...
0
votes
0answers
68 views

php performance issues between two servers

I know this question might be too broad but I'm desperate. Prenote: Here I'm testing php with CLI but same difference occurs with Apache+PHP too. But to avoid Apache caching and other stuff I used ...
2
votes
1answer
211 views

Ec2 Cronjobs - High CPU usage

I have an EC2 Instance (micro) running a cakephp API. This instance serves quality validation before deploying into production. On this instance, we have 5 cronjobs that run once each minute. Those ...
1
vote
1answer
654 views

Do not use .htpasswd when env set to specific value

I have .htpasswd protection on my site that works fine. When I call a script that puts everything into cache via PHP CLI I get a 401 error. The problem here is the .htpasswd protection. In the CLI ...
0
votes
1answer
1k views

CentOS 7 mysqli works on php apache but not on php-cli

I have php7.2 installed(from remi repository) in CentOS 7.5. I want to access mysqli from command line php. When trying, it shows the error: Call to undefined function mysqli_connect() The php ...
0
votes
0answers
3k views

PHP Startup: Unable to load dynamic library php_soap.dll: cannot open shared object file: No such file or directory in Unknown on line 0

After installing PHP soap when I run php via command line it throws an error: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_soap.dll' - /usr/lib/php/20151012/...
1
vote
1answer
6k views

Pass environment variables to the PHP CLI and FPM

I want to use environment variables in my PHP applications both CLI and FPM. What I do is I: export some variables in /etc/environment. configure both php.ini (CLI and FPM) to variables_order = "...
0
votes
1answer
76 views

Where does echo end up when a php script is executed from a shell script?

I have a php script that I execute from a .sh file, and have some echoes in it. if I run the script from the terminal, I can see all the output, but where does it go when it is running in the ...
6
votes
1answer
1k views

Nginx + PHP maximum output limit

I have php 5.5 (fpm) and nginx 1.10 installed (gzip configured to 1). Running on ubuntu. When I am "echoing" a large output (over 2 mb), it stops abruptly at around 520 kb. But same program when I ...
0
votes
1answer
3k views

PHP 7 Module already loaded warnings

I have a machine running Ubuntu 14.04.3 LTS that is deployed via Ansible. I've got PHP 7 installed using Ondřej Surý's PPA for PHP. $ dpkg -l | grep -i php ii libapache2-mod-php7.0 7.0.3-...
2
votes
2answers
3k views

The apache2handler SAPI is not supported by pthreads

It has been weeks now that I cannot install pthreads. I am going to list the error logs then I will list my configuration options. These are the errors I get:(Apache Error Log) The apache2handler ...
3
votes
1answer
2k views

PHP CLI not loading IMAP extension

When I try to run a script that uses imap in my browser, it works fine (it is loaded from a Ubuntu 14.04 server on my network with the extension installed). However, when I try to use PHP CLI on said ...
0
votes
1answer
791 views

Configuring php7.0 with apache2

I'm running the newly released php7.0 on debian jessie. By now it works all fine. Enabling the pdo_mysqli, I have found mutliple configuration directories for php7. There are: apache2 cli fpm I'm ...
0
votes
2answers
165 views

How to run 5 php processes, which uses different eth interfaces?

I'm using cron to run everyday script, which has to run 5 php-cli processes. I need them to use separate interfaces. I have 5 devices, eth0, eth1, eth2, eth3, eth4. How can I call php to make sure ...
0
votes
0answers
1k views

Bus error during PHP5 is running a simple script - what?

When working with PHP scripts, I usually do not have to bother with the underlying system. Today, I have to. A PHP script (cronjob) that has worked fine is crashing since 2 days ago. The cronjob mail ...
3
votes
3answers
4k views

PHP cli uses different php.ini file when run by cron

My CakePHP console script is having problems executing under cron. It complains about missing Mysql connections and such. After a little investigating I found that php run by cron uses a different ...
0
votes
1answer
699 views

What are the affects of disabling CGI on my server to enable PHP CLI

I have a DS WHM - cpanel running apache / with litespeed I have a number of websites running on this server I need to run CLI on one of the sites the CGI module is enabled in the apache build. The ...
2
votes
1answer
4k views

PHP CLI: Call to undefined function mysql_connect() even with mysql module enabled

I try to run a PHP script from the command line, but get the following error: Call to undefined function mysql_connect() However, the mysql module is loaded: root /var/www/scripts # php -m | grep ...
3
votes
2answers
1k views

Enable coloured PHP CLI messages on console [closed]

How to enable coloured messages for PHP CLI on console (Mac OS X, latest PHP/Apache from MacPorts)? export CLICOLOR=1 export LSCOLORS=gxfxcxdxbxegedabagacad doesn't seem to be enough, all PHP CLI ...
4
votes
4answers
28k views

Apache executes HTML, but not PHP; PHP CLI works

I am running php 5.3.3 on rhel 6.2 with Apache 2.2.15 and am failing to get PHP code interpreted by Apache. There are no errors (in the system log, httpd/error_log, or php_errors.log) - I have ...
2
votes
3answers
795 views

PHP-CLI cannot execute scripts on Samba Share (using cifs) inside a guest VM (Centos 6)

I have a centos 6 VM running as a guest within Virtualbox. I've set up a LAMP stack which I am able to access from the host (Windows) environment. I've mounted a SMB share using 'mount -t cifs' and I'...
-1
votes
2answers
768 views

PHP CLI error: Could not startup

I just installed the php5-cli package in Ubuntu 11.04. If I run: /usr/bin/php5 -a # The -a is for interactive mode I get the output: Could not startup.. However, if I add the -n option, which ...
2
votes
2answers
4k views

Changes made to cli's php.ini not taking effect

I have two php.ini files - /etc/php.ini which loads in case of cli /opt/lampp/etc/php.ini which loads in case of browser. I am able to use PHP's Mailparse extension after adding the line ...
2
votes
2answers
5k views

PHP Warning: PHP Startup: apc.shm_segments setting ignored in MMAP mode

Any ideas on how i can fix this warning? Getting this while executing it from shell, on FreeBSD 8.x # /usr/local/bin/php --run 'echo "test";' PHP Warning: PHP Startup: apc.shm_segments setting ...
2
votes
4answers
7k views

Do PHP files need read permission to be executed in CLI?

I have a php file test.php #!/bin/php <?php echo "test"; ?> This file owned by root and its permissions are these -rwxr-x--x so 'others' can execute, but cannot read. When logged in as ...
-2
votes
2answers
163 views

enabling php-cli in php5

i wanted to install php-cli in php5.2.11..does it come built-in or should i install it?