热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

到底哪个是这个php.ini文件呢?-wheretheheckisthisphp.inifileanyways?

Imrunningphpvs.4.1.14onyahoowithphpMyAdmin.itsaysthefileisatusrlibphpphp4.inibu

I'm running php vs. 4.1.14 on yahoo with phpMyAdmin. it says the file is at /usr/lib/php/php4.ini but I can't find this anywhere. Is it in the phpMyAdmin folder? I really need to find this and turn of magic_quotes soon or I'm gonna go postal. Thanks.

我正在使用phpMyAdmin在雅虎上运行php vs. 4.1.14。它说该文件位于/usr/lib/php/php4.ini,但我无法在任何地方找到它。它在phpMyAdmin文件夹中吗?我真的需要很快找到这个和魔法引用,或者我要去邮政。谢谢。

Okay So i guess It wasn't that clear. I did phpinfo(). I don't know how to find that location on the server.....

好吧所以我想这不是那么清楚。我做了phpinfo()。我不知道如何在服务器上找到该位置.....

5 个解决方案

#1


0  

Finding php.ini on a dedicated server can be done easily by phpinfo (as others said)

在专用服务器上查找php.ini可以通过phpinfo轻松完成(正如其他人所说)

But I think you're using a shared hosting environment (so you can not edit php.ini) and actually need to turn off magic_quotes_gpc. (Am I right?) If so, simply create a file named .htaccess in the web root (or phpMyAdmin root) and put the following line in that.

但我认为你正在使用共享托管环境(所以你不能编辑php.ini),实际上需要关闭magic_quotes_gpc。 (我是对的吗?)如果是这样,只需在Web根目录(或phpMyAdmin根目录)中创建一个名为.htaccess的文件,并在其中添加以下行。

php_flag magic_quotes_gpc off  

Hope to help :-)

希望能帮助:-)

#2


3  

  1. Do a phpinfo(): It will tell you the exact full location of the php.ini used.

    做一个phpinfo():它会告诉你使用的php.ini的确切完整位置。

  2. You should not be using PHP 4 any more. :)

    你不应该再使用PHP 4了。 :)

#3


0  

You don't have to turn off magic quotes, just stick this at the top of every page:

您不必关闭魔术引号,只需将其粘贴在每个页面的顶部:

function FixMagicQuotes()
{
    if(get_magic_quotes_gpc())
    {
        foreach($_POST as $key => $value)
        {
            $_POST[$key] = stripslashes($_POST[$key]);
        }
    }
}

FixMagicQuotes();

It will do nothing if magic quotes is disabled. If it is enabled, it will loop throught the POST fields, stripping slashes from each entry.

如果禁用魔术引号,它将无效。如果启用它,它将遍历POST字段,从每个条目中删除斜杠。

#4


0  

The path you found in phpinfo

你在phpinfo找到的路径

/usr/lib/php/php4.ini

is path on the server of your hosting account. The forward slash at the beginning of the path indicates it's a path from the root level of the file system. Think of this like the C:\ folder on a windows machine.

是您的主机帐户的服务器上的路径。路径开头的正斜杠表示它是文件系统根级别的路径。可以想象这就像Windows机器上的C:\文件夹一样。

If you have SSH access to the server you can edit this file with a command line editor ("pico" is the easiest to learn)

如果您具有对服务器的SSH访问权限,则可以使用命令行编辑器编辑此文件(“pico”是最容易学习的)

$ pico /usr/lib/php/php4.ini

If you're using an sFTP client you should have a command (possibly a button or a drop down menu) that is something like "Go to Folder" or "Go to Directory". This should allow you to enter the path

如果您使用的是sFTP客户端,则应该有一个命令(可能是按钮或下拉菜单),类似于“转到文件夹”或“转到目录”。这应该允许您输入路径

/usr/lib/php/

which will drop you in the folder with php.ini.

这会让你在php.ini的文件夹中。

Also via sFTP, when you log in you should see the ".." folder. Clicking on this will move you up a directory from your home directory. Keep click on this until you get to the top, then drill down to

同样通过sFTP,当您登录时,您应该看到“..”文件夹。单击此按钮将从主目录向上移动目录。继续点击这个直到你到达顶部,然后向下钻取

/usr/lib/php

If you're accessing this through a file share of some kind, you're out of luck. Your system admin has effectively locked you out. Also, the above techniques may not work if the administrator of the server has blocked access to these folders and files (often common and necessary in a shared hosting environment)

如果你通过某种文件共享来访问它,那你就不走运了。您的系统管理员已经有效地锁定了您。此外,如果服务器的管理员阻止访问这些文件夹和文件(通常在共享托管环境中常见且必要),则上述技术可能不起作用

#5


0  

If you create a new PHP file with:

如果您使用以下命令创建新的PHP文件:


Then it will show you which php.ini file is loaded

然后它会显示加载了哪个php.ini文件


推荐阅读
author-avatar
彩之乐
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有