Questions tagged [php-cli]
32 questions
1
vote
1 answer
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 call I define my env (ENV=cron), how can I tell my…

Fabian
- 113
- 2
1
vote
2 answers
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 default settings as a fallback.
How can I enable the openssl…

Black
- 461
- 1
- 8
- 20
0
votes
1 answer
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/OrdersCreate.php php…

Asa Carter
- 249
- 1
- 3
- 15
0
votes
0 answers
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 only php cli for testing.
I've two dedicated VM…

Ergec
- 608
- 1
- 9
- 25
0
votes
1 answer
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 running with apache works fine with mysqli. All…

sariDon
- 101
- 4
0
votes
0 answers
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/php_soap.dll: cannot open shared object file: No…

John Magnolia
- 1,723
- 6
- 28
- 46
0
votes
1 answer
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 background?
Is it getting logged somewhere?
To clarify: I…

Sevron
- 131
- 1
- 5
0
votes
1 answer
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+deb.sury.org~trusty+1 amd64 …

DanielGibbs
- 573
- 5
- 13
- 32
0
votes
1 answer
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 aware, that the cli is the command-line php…

simon
- 101
- 1
0
votes
2 answers
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 it uses only one of them?
It's running on Centos 6.6

michail_w
- 113
- 5
0
votes
0 answers
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 as well as running the script via shell both…

BurninLeo
- 900
- 3
- 12
- 30
0
votes
1 answer
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 script I need to run has a configuration check --…

Ledgemonkey
- 103
- 5
0
votes
2 answers
mysql not inserting through php cli
I have a simple php script which is ran from cli. I have tried many different variations of mysql code, but regardless, the line isnt inserted in the database even though php says it is....

Ben
- 23
- 4
0
votes
1 answer
Cronjob Files Not Closing and 100% CPU usage
I'm running a php file every 10 seconds with a cronjob. While the system was running fine, I noticed last night that php was using 100% of the CPU and crashing the system.
When I checked with ps aux, I saw that my cron file had dozens of cron files…

Burak.H
- 5
- 2
0
votes
1 answer
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 there is only apache's index.html in the default…

Praveen
- 103
- 8