简体   繁体   中英

laradock Modify the PHP configuration file to make it work at workspace

  1. I modified the php7.1.ini file to add phar. Readonly = off phar. Readonly = off
  2. use docker-compose restart php-fpm
  3. use docker-compose exec workspace bash
  4. use php xxx phar is error
error info:
disabled by the php.ini setting phar.readonly

How can I get PHP to configure workspace to work? tks.

Which file exactly did you change?

Connect to your workspace and run:

php --ini

Then, copy the 'Loaded Configuration File' path and run (remember to change the path if yours is different):

cat /etc/php/7.3/cli/php.ini | grep -n phar.readonly


laradock@901e2daa988c:/var/www$ cat /etc/php/7.3/cli/php.ini | grep -n 
phar.readonly
1057:; http://php.net/phar.readonly
1058:;phar.readonly = On

It'll probably show that it's ON and the line number. So, just vim into the file and edit and set it to off (remember to change the line number, mine is 1058):

vim +1058 /etc/php/7.3/cli/php.ini

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM