0
votes
2answers
75 views

How do you create separate config files for mod_php on apache and command line php?

I'm looking at the ubuntu sets up php for both apache (mod_php) and php cli. They have one configuration ini in /etc/php5/apache2/php.ini which contains settings for apache+php and another ...
0
votes
1answer
169 views

php -i executed from command line and phpinfo executed from browser show different php parameters

My problem is that when I execute php -i it shows the php version as php 5.4 and the loaded config file as /usr/local/lib/php.ini. When I execute the script phpinfo.php from the command line it shows ...
1
vote
2answers
98 views

Apache Run Command Line Command

I am working on a web server running on Apache in Linux. I am trying to use the system() call from PHP to use the Amazon EC2 Command Line tools (ec2-describe-instance,etc). However, it doesn't work. ...
-2
votes
1answer
89 views

Windows Command Line - Multiple PHP Versions [closed]

I am currently running Wampserver with multiple PHP versions (5.3.8, 5.4.3). Wampserver easily allows you to switch back and forth between the php version you want apache to use. However, I'm having ...
15
votes
4answers
5k views

What's a secure alternative to using a MySQL password on the command line?

We have a PHP command-line script to version a database. We run this script whenever a developer has added a new database patch. The script runs the patch with the MySQL command-line: system('mysql ...
1
vote
4answers
2k views

How to configure PHP CLI on linux ubuntu to run as www-data?

I have a symfony2 application on my ubuntu. Symfony has a plenty of useful console commands (like php app/console cache:clear or php app/console assets:install web). The problem is If I run them as ...
1
vote
2answers
620 views

How to delete files quicker than rm -rf? [duplicate]

Possible Duplicate: Millions of files in php’s tmp error - how to delete? Is there any way how to delete folder/files quicker than with command rm -rf? It seems my disc is filled with ...
2
votes
1answer
192 views

CLI SAPI based daemon, PHP app with cronjobs support

I need to build an CLI SAPI based daemon, PHP app with cronjobs support for iOS platform. We have dedicated server. What kind of PHP environment to run this type of PHP applications?
4
votes
1answer
370 views

PHP Apache XAMPP Run Multiple Scripts from CLI in Background

How can I simultaneously run dozens of PHP scripts in the background from XAMPP's command line interface? Someone suggested a batch file, but when I tried executing this: start php 1.php start php ...
0
votes
1answer
121 views

Issue with PHP and osx 10.7 - runs via command line but not in browser

I recently removed MAMP as I wanted to have more control over my machine and wanted to make use of PHP5.4 I installed using the script located here I cannot now not even get my default PHP that is ...
1
vote
3answers
258 views

Some $_SERVER parameters missing when accessing PHP script via Cron

I have a script that I need to run with PHP via cron. The original author of the script made a lot of user of certain $_SERVER parameters (like REQUEST_URI). But it appears that certain variables ...
8
votes
1answer
989 views

PHP on command line displays “Out of Memory”, no file name, line number or memory value

I originally posted this at http://stackoverflow.com/questions/9665189/php-on-command-line-displays-out-of-memory but was advised to post here instead. This is not the normal fatal error when you run ...
0
votes
2answers
357 views

Adding a CLI for PHP5 on live server

I want to add command-line support for PHP5 on my server. When I run aptitude install php5-cli I get a message saying that my PHP modules/packages have unmet dependencies. Here is a list of packages ...
1
vote
1answer
643 views

Can't change path location of PHP on mac os x snow leopard

I have XAMPP installed on my mac, and I want to make command line PHP use the same executable as XAMPP since I've customized that php's php.ini file. The php binary I want is located at: ...
1
vote
3answers
164 views

Security issues of Running command with PHP script

I want to run a command line program with PHP script. What are the security issues of doing this on VPS? I've heard a lot that this is not secure. But want to know how exactly? Also, what will be the ...
2
votes
2answers
683 views

How can I run a php script from the CLI without prepending “php” to it? [closed]

I'm trying to create a script that runs from the webserver that will run a php file via exec(), but I want it to do so without prepending the php to it. Can this be done? Using Windows 2008 and XAMPP ...
1
vote
1answer
360 views

How to change php binary location in OSX command line

I'm trying to update where the command line gets the location of the php binary: webserver: /usr/bin cli: /opt/local/bin/php Where can I edit so when I do 'which php' it shows me /usr/bin/php
0
votes
2answers
692 views

Trying to connect to mysql via php command line through XAMPP (ubuntu/cakephp)

I am trying to run the cake shell through xampp and I am running into some issues. What works I can connect PHP to Mysql while running through apache (in web browser) I can run the PHP CLI in bash ...
0
votes
1answer
2k views

How come my php settings on CLI and Apache are different? [closed]

I am currently setting up a new Mac Mini Lion server. I am now installing mongodb and apc extension. I want to include the ini settings for the extensions on the /etc/php.d directory (similar with my ...
7
votes
3answers
28k views

How to check my PHP and MySQL version on Ubuntu VPS?

HI I am going to install MyBB but I am not sure whether I have installed the correct version of PHP and MySQL. PHP version 5.1.0 or above with XML Extension installed MySQL version 4.0 or ...
2
votes
2answers
2k views

php cli memory limit

I am getting a memory error in a php cron job: Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 71 bytes) in /opt/matrix/core/lib/DAL/DAL.inc on line 830 The ...
2
votes
1answer
1k views

Setting php error_reporting value with a console parameter

In order to test my PHP projects on errors I normally use this command: find ./ -type f -name \*.php -exec php -l '{}' \; | grep -v "No syntax errors detected" I would like to extend the part php ...
1
vote
1answer
216 views

mysql functions php cli

I'm trying to run Symfony on my new Macbook Pro but I have no luck getting it to work with the command line scripts. With every symfony task related to a database connection the following message ...
2
votes
2answers
6k views

How do you set max execution time of PHP's CLI component?

How do you set max execution time of PHP's CLI component? I have a CLI script that has gone into a infinite loop and I'm not sure how to kill it without restarting. I used quicksilver to launch it, so ...
1
vote
0answers
118 views

Windows 2008 Scheduled Tasks and Parallel instance issue

I have a scheduled task launching a bat file which runs a CLI PHP script. The scheduled task is configured to run every 5 minutes, and run multiple instances in parallel. However, windows is ...
0
votes
1answer
489 views

ionCube - Works on CLI but not with HTTP

I'm trying to install ionCube loader on a CentOS 5 machine. I've installed php 5.3 & ionCube loader through the atomic yum repo. when i check on the command line, php says ionCube loads fine: ...
0
votes
2answers
146 views

Ubuntu - Execute multiple php files via command line

How do I execute multiple php files via command line?
3
votes
1answer
301 views

pidof giving inaccurate result

I want to get the pid of a php script: php /var/www/html/test.php I have a couple of other php scripts running as well, for instance php /var/www/html/hello.php php /var/www/html/world.php When ...
2
votes
2answers
469 views

How to remove require_once calls in a directory (Win)

This is a linux shell command which will comment all require_once calls from certain directory in php files: % cd path/to/ZendFramework/library % find . -name '*.php' -not -wholename ...
1
vote
1answer
493 views

Install PHP both as CGI and CLI

I'm trying to set up development environment for some old projects in PHP 5.1.4. It needs to run as CGI (or fastcgi) under apache and I would like to have cli binary. My configure options are: ...
1
vote
3answers
410 views

Command line PHP script no longer working

A previously working command line PHP script has stopped working - when i run it now it returns this error: [root@server dir]# ./custom.php Extension './custom.php' not present. If i run the script ...
0
votes
2answers
118 views

PHP run on the command line simply outputs the contents of the script

I'm trying to run a PHP script on the command line. listing for myscript.out <?php echo "Hello world"; ?> Let's try running it... $ php myscript.php > myscript.out $ cat myscript.out ...
0
votes
1answer
268 views

Suppress PHP Headers running cgi PHP from Ruby

I originally posted this on StackOverflow and it was suggested that I try posting this here because, "It might be something like the configuration in CGI is different than the configuration for your ...
0
votes
1answer
589 views

Plesk command working in manual script, not in cronjob

In order to install a hosting plan, I use Plesk's commands in SSH as specified in their official guide. When typed directly in SSH (Putty), it works perfectly. The line is as follows with obviously ...
3
votes
3answers
8k views

php cli additional .ini files not loaded

I have compiled PHP 5.3 and everything seems to be working correctly except when running PHP from the command line. When I run: # php --ini it produces this output: Configuration File (php.ini) ...
1
vote
3answers
2k views

CentOS 5 Start a PHP Script on startup

We have a CentOS 5 VPS over at slicehost. I have a couple of PHP scripts that operate email and stuff. I need a way to start these php scripts automatically on machine's reboots/startups and have ...
0
votes
3answers
815 views

why spamc keeps getting me 0/0 when I test it?

on my centos 5 I've installed spamassassin and I want to execute it from php using the command line client. The problem is that each time I run it, I get as result: 0/0 here is how I run it ...