简体   繁体   English

编辑php.ini文件

[英]Editing php.ini file

I'm using phpinfo to find out where the server's php.ini file is located: 我正在使用phpinfo来查找服务器的php.ini文件所在的位置:

<?php phpinfo() ?>

When I log-onto the server using FTP, I don't see it in the path under Loaded Configuration File . 当我使用FTP登录到服务器时,在“ 已加载的配置文件”下的路径中看不到它。

  1. How can I download/edit the php.ini file? 如何下载/编辑php.ini文件?

  2. Can I create a custom php.ini file for one directory (and its sub directories), so that the global PHP settings are not changed? 我可以为一个目录(及其子目录)创建一个自定义php.ini文件,以便不更改全局PHP设置吗?

probably you don't have permissions to view the file. 可能您没有查看该文件的权限。 what you can do is make a custom_settings.php and use ini_set() to change the configurations and include that file where ever need, to change the configuration settings. 您可以做的是创建一个custom_settings.php并使用ini_set()更改配置,并在需要时包括该文件,以更改配置设置。 Please refer to http://us1.php.net/ini_set 请参考http://us1.php.net/ini_set

如果安装了Direct Admin,则可以以admin身份登录并在此处进行编辑。

It should be on location 它应该在位置上

/etc/php.ini

If not found there, you can search it by using 如果在此处找不到,可以通过使用进行搜索

locate php.ini

If you want to change any values​​, try to do it in .htaccess file 如果要更改任何值,请尝试在.htaccess文件中进行更改

Examples: 例子:

php_flag   display_errors       Off
php_value  upload_max_filesize  2M
php_value  error_reporting      0
php_flag   magic_quotes_gpc     Off

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

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