在无家可归的宅基地上配置php.ini [英] configure the php.ini on vagrant homestead
问题描述
我想在php.ini中允许short_open_tags
I want to allow short_open_tags in php.ini
我想访问配置了宅基的无业游民框上的php.ini. 我在/etc/php5/fpm/php.ini中看到了php.ini文件
I want to access to the php.ini on my vagrant box configured with homestead. I saw the php.ini file in /etc/php5/fpm/php.ini
但是...权限被拒绝 有人知道吗?
But ... permission denied Is somebody knows ?
谢谢
推荐答案
以下是您授予对php.ini的读/写访问权限,对其进行修改,保存更改&的方法.重新加载nginx:
Here is how you grant read/write access to php.ini, modify it, save changes & reload nginx:
1..导航到包含php.ini的文件夹:$ cd /etc/php5/fpm
1. Navigate to folder containing php.ini: $ cd /etc/php5/fpm
2..授予读/写访问权限:$ sudo chmod -R ugo+rw php.ini
2. Grant read/write access: $ sudo chmod -R ugo+rw php.ini
3..打开php.ini:$ vim php.ini
3. Open php.ini: $ vim php.ini
4..进入编辑模式:$ i
5.编辑内容
6..退出编辑模式:按ESC
6. Exit edit mode: Press ESC
7.保存并保存.关闭php.ini:$ :x!
7. Save & close php.ini: $ :x!
7.1 可选:不保存即退出:$ :q
7.1 OPTIONAL: Exit without saving: $ :q
8..导航到首页(不确定是否确实必要):$ cd ~
8. Navigate to home (not sure if this is actually necessary): $ cd ~
9..重新加载/重新启动nginx:$ sudo nginx -s reload
9. Reload/Restart nginx: $ sudo nginx -s reload
10.1 重新加载/重新启动php:$ sudo service php5-fpm restart
10.1 Reload/Restart php: $ sudo service php5-fpm restart
10.2 (如果使用PHP 7,则使用$ sudo service php7.0-fpm restart
)(感谢Richard在评论中).
10.2 If using PHP 7 then use $ sudo service php7.0-fpm restart
(Thanks & Credit to Richard in comments).
11. ???
12.盈利! (或者那个笑话真的太老了吗?)
12. PROFIT! (or is that joke really too old?)
以下是屏幕截图:
请记住,如果您运行$ vagrant provision
,它将重置所有配置文件.就是这样.
Remember if you run $ vagrant provision
, it'll reset all configuration files. Just so you know.
编辑
了解超级有用. 您可以通过退出输入模式在vim中搜索,然后输入$ /post_max_size
或您要查找的任何内容.
Super useful to know. You can search in vim by exiting input mode, and type $ /post_max_size
or whatever you want to find.
这篇关于在无家可归的宅基地上配置php.ini的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!