Page 1 of 1

failed to open directory...

Posted: Fri Jun 21, 2013 10:21 am
by f0rc3d
hello, im a new newuser of netjukebox
and the following is the issue i am having when trying to update,
can anyone PLEASE HELP! :)

this is how i have the config.inc.php set...
Image
my "music" directory is chmod to 777

and here is the error i am getting...
Image

Re: failed to open directory...

Posted: Fri Jun 21, 2013 11:03 am
by wbartels
I think the web server doesn't have enough privileges to access this directory.
The web server user (www-data on Ubuntu) must have read and write access to this directory!

For example give yourself (f0rc3d) and the web server read and write access:

Code: Select all

chown -R f0rc3d:www-data /music/
chmod -R 664 /music/
Or give everyone read and write access:

Code: Select all

chmod -R 666 /music/
For more info over filepermission take a look here:
https://help.ubuntu.com/community/FilePermissions

Re: failed to open directory...

Posted: Fri Jun 21, 2013 11:11 am
by wbartels
Sorry, now I see you already have used chmod 777.
Did you use the -R switch?

Re: failed to open directory...

Posted: Thu Jan 16, 2014 10:18 pm
by wrath
i am facing the same issue,
1. i am setting the address of folder in config file : /domains/wrath.ir/public_html/music/ something like this
2.i am giving the /music/ folder permissions 777
3.i am using directadmin v1.43 as a host manager
can you help me please ? i have about zero info about linux operating systems

Re: failed to open directory...

Posted: Thu Jan 16, 2014 10:40 pm
by wbartels
wrath wrote:i am facing the same issue,
1. i am setting the address of folder in config file : /domains/wrath.ir/public_html/music/ something like this
2.i am giving the /music/ folder permissions 777
3.i am using directadmin v1.43 as a host manager
can you help me please ? i have about zero info about linux operating systems
If you use /domains/wrath.ir/public_html/music/ you shoud set permission 777 to /domains/wrath.ir/public_html/music/ and not to /music/

Re: failed to open directory...

Posted: Thu Jan 16, 2014 10:48 pm
by wrath
thanks for the reply
i did not quite undrestand what do you mean,so i have to give each folder 777 permission like give /domains/ 777 /wrath.ir/777 and so on ?

Re: failed to open directory...

Posted: Wed Jan 02, 2019 5:42 pm
by adink
I have read this post expecting to find the remedy to my issue. For you, I am sure it's old hat, but I seem to be missing. I'm using web services from 1 and 1 the server is Linux. My audio files are in http://subdomain.domain.net/data/music I have set the music folder to 644 and even 777 and I still get the error Enable write permission for directory /data/Music/
I didn't see the remedy here.
Hoping you can help!

Re: failed to open directory...

Posted: Wed Jan 02, 2019 6:58 pm
by wbartels
adink wrote: Wed Jan 02, 2019 5:42 pm I have read this post expecting to find the remedy to my issue. For you, I am sure it's old hat, but I seem to be missing. I'm using web services from 1 and 1 the server is Linux. My audio files are in http://subdomain.domain.net/data/music I have set the music folder to 644 and even 777 and I still get the error Enable write permission for directory /data/Music/
I didn't see the remedy here.
Hoping you can help!
The directory /data/Music/ uses an uppercase M and the url uses a lowercase m!

Re: failed to open directory...

Posted: Thu Jan 03, 2019 4:48 am
by adink
Thanks for your reply.
I corrected that issue which was caps in the config file however, I am still getting the same error now with the correct case.

Re: failed to open directory...

Posted: Thu Jan 03, 2019 6:25 pm
by wbartels
adink wrote: Wed Jan 02, 2019 5:42 pm I have read this post expecting to find the remedy to my issue. For you, I am sure it's old hat, but I seem to be missing. I'm using web services from 1 and 1 the server is Linux. My audio files are in http://subdomain.domain.net/data/music I have set the music folder to 644 and even 777 and I still get the error Enable write permission for directory /data/Music/
I didn't see the remedy here.
Hoping you can help!
You used a relative directory, but it must be the full directory!
You can find the root directory with phpinfo() and search for _SERVER["SCRIPT_FILENAME"]

Code: Select all

_SERVER["SCRIPT_FILENAME"]	/home/project-web/netjukebox/htdocs/phpinfo.php
With the above example you should use:

Code: Select all

$cfg['media_dir'] = '/home/project-web/netjukebox/htdocs/data/music/';
Enable $cfg['php_info'] in the config file or use a one line script like:

Code: Select all

phpinfo();
or

Code: Select all

echo __DIR__;
Good luck ;-)

Re: failed to open directory...

Posted: Fri Jan 04, 2019 6:27 am
by adink
ok Thanks again, I will do that :D

Re: failed to open directory...

Posted: Fri Jan 04, 2019 5:41 pm
by adink
I included the full path to the sound folder in config.ini.php now I get the error:

Enable write permission for directory /subdomain/domain.org/data/music/

I can only assume that you are talking about the phpinfo within the root dir of the netjukebox installation.
I get no such line in the script.
script follow as is
--------------------------------------------------
<?php
// +------------------------------------------------------------------------+
// | netjukebox <http://www.netjukebox.nl> |
// | Copyright (C) 2001-2018 Willem Bartels |
// | |
// | This file is part of netjukebox. |
// | |
// | netjukebox is free software: you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation, either version 3 of the License, or |
// | (at your option) any later version. |
// | |
// | netjukebox is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with netjukebox. If not, see <https://www.gnu.org/licenses/>. |
// +------------------------------------------------------------------------+




// +------------------------------------------------------------------------+
// | phpinfo.php |
// +------------------------------------------------------------------------+
define('NJB_RUN', true);
require_once('include/initialize.inc.php');
authenticate('access_admin');

if ($cfg['php_info'] == false)
message(__FILE__, __LINE__, 'error', 'Error[br]phpinfo disabled');

ob_start();
phpinfo();
$phpinfo = ob_get_contents();
ob_end_clean();

$phpinfo = preg_replace('#a:link \{.+?\}#', 'a:link, a:visited {color: #000099; text-decoration: none;}', $phpinfo, 1);
$phpinfo = preg_replace('#PHP Version#', '<a href="config.php">netjukebox ' . html(NJB_VERSION) . '</a> | PHP Version', $phpinfo, 1);
echo $phpinfo;

Re: failed to open directory...

Posted: Fri Jan 04, 2019 9:53 pm
by wbartels
  1. Enable $cfg['php_info'] in the config.inc.php file.
  2. Open netjukebox > Config > PHP information.
  3. See previous post.

Re: failed to open directory...

Posted: Sat Jan 05, 2019 11:28 am
by adink
Oh! ok, I see it now. My bad thanks again.

Re: failed to open directory...

Posted: Tue Jan 08, 2019 12:32 am
by adink
Forgive me for not closing the topic. something came up on this side and I have not been able to get back to netjukebox Hoping to resume soon.
Thanks for all the help so far.