简体   繁体   English

chmod()[function.chmod]:权限被拒绝

[英]chmod() [function.chmod]: Permission denied

I need assistance for my project. 我的项目需要协助。 I created the chmod <?php chmod("../database.php",0777); ?> 我创建了chmod <?php chmod("../database.php",0777); ?> <?php chmod("../database.php",0777); ?> that is in inside install folder then the dabase.php is in the root. <?php chmod("../database.php",0777); ?>位于安装文件夹中,则dabase.php位于根目录中。 I am using godaddy. 我在用哥达迪。 I tried to use Filezilla and input 777 or 755 to set the permission, I got some error from ftp filezilla: 我尝试使用Filezilla并输入777或755来设置权限,但是从ftp filezilla中得到了一些错误:

Command:    CWD /
Response:   250 CWD command successful.
Command:    SITE CHMOD 777 install
Response:   500 'SITE CHMOD 777 install': command not understood
Status: Retrieving directory listing of "/"...
Status: Directory listing of "/" successful
Status: Set permissions of '/install/1.php' to '777'
Command:    CWD /install
Response:   250 CWD command successful.
Command:    SITE CHMOD 777 1.php
Response:   500 'SITE CHMOD 777 1.php': command not understood

And there is no options in Godaddy file manager for privacy setting for page to setup the the permission. 而且,Godaddy文件管理器中没有用于页面隐私设置的选项来设置权限。 and I also set permission to the folder on which the chmod are in. 并且我还为chmod所在的文件夹设置了权限。

Here is the code in database file: 这是数据库文件中的代码:

    <?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$db['default']['username'] = "usernamedb";
$db['default']['password'] = "mypassword";
$db['default']['database'] = "mydb";

$db['default']['hostname'] = "localhost";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = FALSE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
$active_group = "default";
$active_record = TRUE;

Note: the information of the code is not the actually for password and username etc for my privacy. 注意:代码的信息实际上并不是我的密码和用户名等,以保护我的隐私。

and Here's the error I got: 这是我得到的错误:

Warning: chmod() [function.chmod]: Permission denied in D:\\Hosting\\11924492\\html\\install\\1.php on line 2 警告:chmod()[function.chmod]:第2行的D:\\ Hosting \\ 11924492 \\ html \\ install \\ 1.php中的权限被拒绝

Hope anyone can help me. 希望任何人都能帮助我。

Thank you 谢谢

Oldskool is right, you really shouldn't use 777. However, the crux of your issue is that you are attempting to use chmod on a windows environment (the clue is the path to your PHP file: D:\\Hosting\\11924492\\html\\install\\1.php ). Oldskool是正确的,您实际上不应该使用777。但是,问题的症结在于您试图在Windows环境中使用chmod (线索是您的PHP文件的路径: D:\\Hosting\\11924492\\html\\install\\1.php )。 chmod is a unix command. chmod是一个Unix命令。

It does look like GoDaddy offers a way for you to edit file permissions on their windows machines through their console: https://www.godaddy.com/help/set-directory-permissions-windows-6481 看起来GoDaddy确实为您提供了一种通过其控制台在Windows计算机上编辑文件权限的方法: https : //www.godaddy.com/help/set-directory-permissions-windows-6481

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

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