0

I need assistance for my project. I created the chmod <?php chmod("../database.php",0777); ?> that is in inside install folder then the dabase.php is in the root. 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:

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. and I also set permission to the folder on which the chmod are in.

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

Hope anyone can help me.

Thank you

gen_Eric
  • 223,194
  • 41
  • 299
  • 337
ryan jeff
  • 891
  • 6
  • 7
  • 1
    You should *never* set permission 777. It's the "lazy man's way". If you "need" 777 for your site/script to function, it means you have an ownership problem which you should fix, rather than opening the door for anyone to mess with your files. At most, chmod 775 should be needed. Also see [How will a server become vulnerable with chmod 777?](http://stackoverflow.com/questions/11271596/how-will-a-server-become-vulnerable-with-chmod-777) – Oldskool Nov 11 '15 at 16:27
  • Hi Oldskool. I'm planning to setup 777 then after the installation of the application I will back to secure environment. but I will try this 775 if it will work. – ryan jeff Nov 11 '15 at 19:57
  • The problem using 775 is the same, I still got the permission denied. Status: Set permissions of '/database.php' to '775' Command: SITE CHMOD 775 database.php Response: 500 'SITE CHMOD 775 database.php': command not understood – ryan jeff Nov 11 '15 at 20:27

1 Answers1

1

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). chmod is a unix command.

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

jpschroeder
  • 6,636
  • 2
  • 34
  • 34
  • the details from godaddy is not available. if you have offline copy please do let me know. thank you – ryan jeff Nov 11 '15 at 19:59
  • jpschroeder. I found it, the link is not working in Italy, so I redirect to US. but the instructions from godaddy is for folder. I am referring to page file .php not folder permissions. let me know if you have idea or experience regarding this. Thanks – ryan jeff Nov 11 '15 at 20:21