Questions tagged [php-cli]
PHP CLI is the command-line interface for PHP.
47 questions
1
vote
2
answers
54
views
Update PHP cli on Ubuntu 22.04 LTS
I'm running Ubuntu 22.04 LTS server (plus Plesk Obsidian 18.0.77 Update #1)
Despite Plesk updates being up to date, and Ubuntu updates being up to date (sudo apt update && sudo apt upgrade), ...
21
votes
5
answers
212k
views
Run PHP from the command line
I have installed XAMPP v1.8.3 for my PHP development. I am new to Ubuntu, so I don't know how to set environment variable for PHP which is located at /opt/lampp/bin/php.
I can run PHP scripts from ...
0
votes
1
answer
63
views
kubuntu 22.04 won't run PHP cronjobs normally anymore (logs stay empty, script is never ran)
i have a PHP script that has ran correctly up to about 3 or 4 days ago, also from crontab.
it fetches RSS news items and puts them into a db.
the problem i have at the moment is that this script will ...
1
vote
1
answer
14k
views
Trouble updating PHP version used by Apache on Ubuntu 22.04
I have multiple PHP versions (8.1/8.2/8.3) installed on my Ubuntu 22.04 system. I'm trying to switch between them using the sudo update-alternatives --config PHP command. However, I'm facing an issue ...
1
vote
1
answer
1k
views
Run PHP (in console) with Geany
I can manually go to terminal and write php filename.php and it will run it successfully for me. I just need to know how I can do it from Geany.
Proof:
gnome-terminal -e "php %f" is what I ...
1
vote
1
answer
6k
views
How to correct the command for PHP 7.0.* in following PHP cli and git installation?
I'm using Ubuntu Linux 14.04 LTS 64-bit OS on my machine.
I just updated all the softwares and packages installed on my system by running following commands from the terminal :
sudo apt-get update
...
2
votes
1
answer
4k
views
'LIBXML2_2.9.0' not found (run PHP-file with shell_exec)
I wrote a PHP-script to execute another PHP-file in the terminal and got an error. If I run:
$output = shell_exec("/usr/bin/php -v 2>&1");
echo "<PRE>$output</PRE>";
then I get ...
16
votes
3
answers
38k
views
Why isn't Composer updated?
I'm using Ubuntu 16.04 LTS amd64. I have installed LAMP (php5.6, apache2, mysql) and Composer. I downloaded my Laravel project from GitHub. I would like to update Composer to start the local server ...
2
votes
1
answer
1k
views
In crontab, what does "/usr/bin/php -f" do? Specifically, the -f
In crontab, what does /usr/bin/php -f do? Specifically, the -f
Not sure what that does, but I'm seeing it in a crontab I've came across.
0
votes
2
answers
5k
views
How to run XAMPP Shell in Linux
I just recently installed Ubuntu, installed XAMPP, run it(Apache + MySQL working). Now I'd like to use shell to run some of the PHP files.
On Windows, I simply run the XAMPP Control Panel and I'm able ...
2
votes
1
answer
842
views
Cronjobs not working but same command works fine from command line
I’ve installed Mautic (email program). It needs 3 cronjobs to run properly.
php /var/www/mydomainname/htdocs/app/console mautic:segments:update
php /var/www/mydomainname/htdocs/app/console mautic:...
6
votes
3
answers
6k
views
Change text-color of php output on command prompt?
Suppose I've a php file and I want to change text-colour of my output for a console based application...
<?php
$prompt = "What Is Your Name: ";
echo $prompt;
$answer = "You Entered: ...
2
votes
2
answers
773
views
Ubuntu 16.04 with PHP7.0 and ISPConfig
I have the server running fine even after upgrade from 14.04. However, now that I need to perform a ISPConfig upgrade I found out that the PHP CLI is an older version. I've removed any other instances ...
1
vote
1
answer
7k
views
How to make work such a command: "$ sudo php -v"?
I have installed and working PHP53 from source.
PATH is set in ~/.profile like this: export PATH=$PATH:/usr/local/php53/bin
$ php -v # works good
BUT:
$ sudo php -v # sudo: php: command not found
I ...
6
votes
4
answers
21k
views
Unable to execute the laravel command "laravel new myapp"
Using Ubuntu 16.04. When I execute laravel new myapp, I am getting this:
[RuntimeException]
The Zip PHP extension is not installed. Please ...