简体   繁体   English

laradock修改PHP配置文件以使其在工作空间中工作

[英]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 我修改了php7.1.ini文件以添加phar. Readonly = off phar. Readonly = off
  2. use docker-compose restart php-fpm 使用docker-compose restart php-fpm
  3. use docker-compose exec workspace bash 使用docker-compose exec workspace bash
  4. use php xxx phar is error 使用php xxx phar错误
error info:
disabled by the php.ini setting phar.readonly

How can I get PHP to configure workspace to work? 如何获取PHP以配置工作区才能正常工作? tks. 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. 它可能会显示它为ON和行号。 So, just vim into the file and edit and set it to off (remember to change the line number, mine is 1058): 因此,只需将vim插入文件并进行编辑并将其设置为关闭(请记住更改行号,我的是1058):

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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