Questions tagged [php-cli]

32 questions
6
votes
1 answer

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 run on php-cli, it has no problem "echoing" the…
hakacadera
  • 61
  • 2
5
votes
4 answers

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 enabled error reporting in php.ini: error_reporting =…
geoweaser
  • 63
  • 1
  • 1
  • 7
3
votes
1 answer

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 server, it doesn't load imap. I wrote a simple…
captainGeech
  • 153
  • 5
3
votes
3 answers

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 php.ini file compared to when I run it in the…
Jelle De Loecker
  • 1,055
  • 6
  • 16
  • 29
3
votes
2 answers

Enable coloured PHP CLI messages on console

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 produced output is colourless on the console. Would…
Ain
  • 188
  • 7
2
votes
1 answer

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 cronjobs, 98% of the time run a Mysql Query and…
Cafn
  • 131
  • 2
2
votes
2 answers

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 SAPI is not supported by pthreads in Unknown on line…
D.elp
  • 121
  • 1
  • 6
2
votes
1 answer

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 mysql mysql mysqli pdo_mysql I am on a Debian…
Matthias
  • 282
  • 3
  • 16
2
votes
3 answers

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'm able to use apache to serve files from that…
calumbrodie
  • 182
  • 1
  • 2
  • 12
2
votes
2 answers

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 extension=mailparse.so in the /opt/lampp/etc/php.ini and…
Sandeepan Nath
  • 617
  • 6
  • 13
  • 27
2
votes
2 answers

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 ignored in MMAP mode in Unknown on line 0 test …
Phliplip
  • 531
  • 8
  • 21
2
votes
4 answers

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

I have a php file test.php #!/bin/php This file owned by root and its permissions are these -rwxr-x--x so 'others' can execute, but cannot read. When logged in as other user than root and trying to run this file from the…
1
vote
1 answer

/usr/bin/php vs /bin/php vs php in bash

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 || which php || type -p php => /usr/bin/php ((…
Phung D. An
  • 150
  • 8
1
vote
0 answers

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 execution of the script so that the CRON job can execute…
Ablue
  • 1,140
  • 1
  • 12
  • 32
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
2 3