Where is the php.ini file on a Linux/CentOS PC?(Linux/CentOS PC 上的 php.ini 文件在哪里?)
问题描述
我在我的服务器上找不到 PHP.ini 位置.我检查了所有 Stack Overflow 答案,但找不到我的 php.ini 位置.
I can't find PHP.ini location on my server. I've checked all Stack Overflow answers but I can't find my php.ini location.
我有 Linux、Cent OS、zPanel.PHP 的最新版本.
I have Linux, Cent OS, zPanel. Last version of PHP.
我的电脑:Linux Mint 15 KDE.
My computer: Linux Mint 15 KDE.
推荐答案
在你的终端/控制台中(只有 Linux,在 windows 中你需要 腻子)
In your terminal/console (only Linux, in windows you need Putty)
ssh user@ip
php -i | grep "Loaded Configuration File"
它会显示类似这样的内容 Loaded Configuration File =>/etc/php.ini.
And it will show you something like this Loaded Configuration File => /etc/php.ini.
替代方法
你可以在你的网站上创建一个php文件,运行:<?php phpinfo();?>,可以看到php.ini的位置在一行:"Loaded Configuration File".
You can make a php file on your website, which run: <?php phpinfo(); ?>, and you can see the php.ini location on the line with: "Loaded Configuration File".
更新该命令立即给出路径
cli_php_ini=php -i | grep /.+/php.ini -oE #ref. https://stackoverflow.com/a/15763333/248616
php_ini="${cli_php_ini/cli/apache2}" #replace cli by apache2 ref. https://stackoverflow.com/a/13210909/248616
这篇关于Linux/CentOS PC 上的 php.ini 文件在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Linux/CentOS PC 上的 php.ini 文件在哪里?
基础教程推荐
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 如何替换eregi() 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
