Questions tagged [php-cli]

PHP CLI is the command-line interface for PHP.

46 questions
22
votes
5 answers

How to change PHP version in Ubuntu 20.04 console?

How can I change the PHP version used in console on Ubuntu 20.04? I have all versions in the /etc/php folder, but I don't know where the configuration for the command line version is.
Čamo
  • 849
21
votes
5 answers

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 localhost just fine, but I wanted to run them from…
16
votes
3 answers

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 php artisan serve. But when I would like to run…
10
votes
3 answers

Use php command instead of full path with xampp installation?

I have Xubuntu installation and XAMPP installed on my PC, and everything works great. However, lately I am experimenting a little bit with Laravel framework and a lot of tutorials and people just use PHP command in terminal, but for me to work I…
lonerunner
  • 393
  • 1
  • 6
  • 21
6
votes
4 answers

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 install it and try again. new [--dev] [--5.2] [--]…
varun
  • 73
6
votes
3 answers

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... I want to change…
6
votes
2 answers

Run PHP script from command line?

How can I simply run a PHP script in the command line? Also is it possible to run it like it would be if the URL was typed in?
5
votes
1 answer

How to enable OpenSSL for PHP Cli?

There is no major difference in the php.ini files located at /etc/php5/apache2/php.ini and /etc/php5/cli/php.ini. But when accessed from a browser says OpenSSL support enabled whereas php -info | grep openssl executed in a…
Vivek
  • 3,829
4
votes
1 answer

How can one call programs that are not "rooted" in the operating system

I am currently trying to install a php extension on my computer. I am in the process of developing a new site and I am using LAMPP. I used PECL to install the syck YAML extension so that I can parse YAML to a PHP array in a file that will run daily…
3
votes
1 answer

How to Fix Could not open input file in php CLI 7.0

How to run php cli right in Ubuntu 16.04? When I enter the command php file.php always out the error Could not open input file: file.php How can I fix it?
3
votes
1 answer

Why does PHP's composer require command hang?

Note: I know this is a PHP question, but - and I could be wrong here - but I think the problem may only exist with PHP, composer on ubuntu. Anyway, almost every tutorial, including composer itself say run the composer require command to install a…
3
votes
1 answer

PHP interactive interpreter: Delete and Ctrl +Aarrows keys don't work properly

When running PHP interactive interpreter with: php -a Delete button doesn't work (produces ~ instead), jumping over words with Ctrl+Left Arrow and Ctrl+Right Arrow doesn't work either (;5D and ;5C, respectively). It annoys me a lot - I use php -a…
3
votes
1 answer

PHP Environment Variables in CLI

Environment Variables are used to set up the PHP application and the application runs smoothly. The issue that I'm facing is when I'm trying to reference the application's database connection file and run it from CLI. Apache Set Up:
2
votes
2 answers

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 of PHP. phpinfo() running on Apache reports…
2
votes
1 answer

Executing PHP gives error on command line interface, but works in browser

Any idea what could cause a PHP file to execute fine in the browser, but give an error when run in the command line interface? So to be specific, when I visit mysite.com/script.php in a browser, all is well. When I execute php -f…
Zack
  • 123
1
2 3 4