Link to home
Start Free TrialLog in
Avatar of Eduardo Fuerte
Eduardo FuerteFlag for Brazil

asked on

Could you point how to correctly configure PHP to use with Laravel?

Hi Experts

Could you point how to correctly configure PHP to use with Laravel?

After a composer update this error occurs
- laravel/framework v5.2.9 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.

To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.2/cli/php.ini
    - /etc/php/7.2/cli/conf.d/10-mysqlnd.ini
    - /etc/php/7.2/cli/conf.d/10-opcache.ini
    - /etc/php/7.2/cli/conf.d/10-pdo.ini
    - /etc/php/7.2/cli/conf.d/20-calendar.ini
    - /etc/php/7.2/cli/conf.d/20-ctype.ini
    - /etc/php/7.2/cli/conf.d/20-exif.ini
    - /etc/php/7.2/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.2/cli/conf.d/20-ftp.ini
    - /etc/php/7.2/cli/conf.d/20-gettext.ini
    - /etc/php/7.2/cli/conf.d/20-iconv.ini
    - /etc/php/7.2/cli/conf.d/20-json.ini
    - /etc/php/7.2/cli/conf.d/20-mysqli.ini
    - /etc/php/7.2/cli/conf.d/20-pdo_mysql.ini
    - /etc/php/7.2/cli/conf.d/20-pdo_sqlite.ini
    - /etc/php/7.2/cli/conf.d/20-phar.ini
    - /etc/php/7.2/cli/conf.d/20-posix.ini
    - /etc/php/7.2/cli/conf.d/20-readline.ini
    - /etc/php/7.2/cli/conf.d/20-shmop.ini
    - /etc/php/7.2/cli/conf.d/20-sockets.ini
    - /etc/php/7.2/cli/conf.d/20-sqlite3.ini
    - /etc/php/7.2/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.2/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.2/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.2/cli/conf.d/20-tokenizer.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Open in new window


The modules I have installed:
marianne@marianne-Inspiron-1525:/var/www/html/laravel5-example$ apt-cache pkgnames | grep php7.2
php7.2-common
php7.2-cli
php7.2-mysql
php7.2
php7.2-sqlite3
php7.2-json
php7.2-opcache
php7.2-readline
libapache2-mod-php7.2

Open in new window


My try to configure by getting a package:
marianne@marianne-Inspiron-1525:/var/www/html$ sudo apt-get install php7.2-mbstring
Lendo listas de pacotes... Pronto
Construindo árvore de dependências       
Lendo informação de estado... Pronto
E: Impossível encontrar o pacote php7.2-mbstring
E: Couldn't find any package by glob 'php7.2-mbstring'
E: Não foi possível encontrar o pacote através da expressão regular 'php7.2-mbstring'
(Not possible to find the package by regular expression 'php7.2-mbstring'

Open in new window


I tryed another alternatives obtained by google, no succeded.

Could you suggest a workaround?

Thanks in advance.
SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Eduardo Fuerte

ASKER

Hi

Even following what you suggested and the restarting apache, the error remains (completed copied)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework v5.2.9 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.8 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.7 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.6 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.5 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.45 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.44 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.43 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.42 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.40 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.39 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.38 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.37 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.36 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.35 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.34 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.33 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.32 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.31 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.30 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.29 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.27 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.26 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.25 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.24 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.23 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.22 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.21 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.20 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.19 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.18 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.17 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.16 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.15 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.14 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.13 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.12 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.11 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.10 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework 5.2.41 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.2.45 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - Installation request for laravel/framework 5.2.* -> satisfiable by laravel/framework[5.2.41, v5.2.0, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.32, v5.2.33, v5.2.34, v5.2.35, v5.2.36, v5.2.37, v5.2.38, v5.2.39, v5.2.4, v5.2.40, v5.2.42, v5.2.43, v5.2.44, v5.2.45, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9].

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.2/cli/php.ini
    - /etc/php/7.2/cli/conf.d/10-mysqlnd.ini
    - /etc/php/7.2/cli/conf.d/10-opcache.ini
    - /etc/php/7.2/cli/conf.d/10-pdo.ini
    - /etc/php/7.2/cli/conf.d/20-calendar.ini
    - /etc/php/7.2/cli/conf.d/20-ctype.ini
    - /etc/php/7.2/cli/conf.d/20-exif.ini
    - /etc/php/7.2/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.2/cli/conf.d/20-ftp.ini
    - /etc/php/7.2/cli/conf.d/20-gettext.ini
    - /etc/php/7.2/cli/conf.d/20-iconv.ini
    - /etc/php/7.2/cli/conf.d/20-json.ini
    - /etc/php/7.2/cli/conf.d/20-mysqli.ini
    - /etc/php/7.2/cli/conf.d/20-pdo_mysql.ini
    - /etc/php/7.2/cli/conf.d/20-pdo_sqlite.ini
    - /etc/php/7.2/cli/conf.d/20-phar.ini
    - /etc/php/7.2/cli/conf.d/20-posix.ini
    - /etc/php/7.2/cli/conf.d/20-readline.ini
    - /etc/php/7.2/cli/conf.d/20-shmop.ini
    - /etc/php/7.2/cli/conf.d/20-sockets.ini
    - /etc/php/7.2/cli/conf.d/20-sqlite3.ini
    - /etc/php/7.2/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.2/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.2/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.2/cli/conf.d/20-tokenizer.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Open in new window



Here is my php.ini
php.ini

I have uncommented some other extensions based on the error on PHP.ini  also...

The PHP configuration folder, mentioned at the error message too:
User generated image
A lot of .ini that is mentioned at the error message that I verified are also enabled:
F.e.
10-mysqlnd.ini
and
10-mysqlnd.ini

If it helps I could send you the others.

Really intricated how to configure PHP at Ubuntu in order to run Laravel.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Marco

Such a long time whe don't met here!
I'm going to read...
Reading your article.... (

Something is needed I had tryed before still is producing errors at my PC!

                                                  
marianne@marianne-Inspiron-1525:/var/www/html/laravel5-example$ sudo apt-get install php7.0-mbstring
Reading package lists ... Ready
Building Dependency Tree
Reading Status Information ... Ready
E: The php7.0-mbstring package could not be found
E: Could not find any packages by glob 'php7.0-mbstring'
E: Could not find package with regular expression 'php7.0-mbstring'

marianne@marianne-Inspiron-1525:/var/www/html/laravel5-example$ sudo apt-get install php7.2-mbstring
Reading package lists ... Ready
Building dependency tree
Reading status information ... Ready
E: Unable to find package php7.2-mbstring
E: Could not find any package by glob 'php7.2-mbstring'
E: The package could not be found through the regular expression 'php7.2-mbstring'

Open in new window


Any workaround?

(I'm going to better explore your articles , more in deep Laravel article step-by-step)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Still not running

marianne@marianne-Inspiron-1525:/var/www/html/laravel5-example$ sudo yum install php7.2-mbstring
sudo: yum: command not found

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great, now restart the Apache and this error shouldn't be there anymore.
Avatar of noci
noci

yum is for RHEL and other RPM based installs.
Ubuntu is a debian derived distro and needs apt-get ...

Appearantly you are missing a REPO...

Duh... Edit: Q was just answered.... (few minutes go)

Great, now restart the Apache and this error shouldn't be there anymore.

Yes, after that, a new error arised but then I returned back to Marco's article and run...

sudo apt-get install phpunit

Open in new window


So composer update run OK!
Thank you for the assistance!

Marco, very nice blog!

step exceeded...

Now  I'm struggling with Laravel data migrations, soon another question...
Glad to help you. Unfortunately, my activity in EE is very limited lastly...(