failed to open directory...

Linux related discussion about netjukebox
Locked
f0rc3d

failed to open directory...

Post 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
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: failed to open directory...

Post 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
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: failed to open directory...

Post by wbartels »

Sorry, now I see you already have used chmod 777.
Did you use the -R switch?
wrath
User
Posts: 2
Joined: Thu Jan 16, 2014 3:22 am

Re: failed to open directory...

Post 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
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: failed to open directory...

Post 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/
wrath
User
Posts: 2
Joined: Thu Jan 16, 2014 3:22 am

Re: failed to open directory...

Post 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 ?
adink
User
Posts: 6
Joined: Wed Jan 02, 2019 4:06 pm

Re: failed to open directory...

Post 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!
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: failed to open directory...

Post 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!
adink
User
Posts: 6
Joined: Wed Jan 02, 2019 4:06 pm

Re: failed to open directory...

Post 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.
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: failed to open directory...

Post 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 ;-)
adink
User
Posts: 6
Joined: Wed Jan 02, 2019 4:06 pm

Re: failed to open directory...

Post by adink »

ok Thanks again, I will do that :D
adink
User
Posts: 6
Joined: Wed Jan 02, 2019 4:06 pm

Re: failed to open directory...

Post 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;
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: failed to open directory...

Post by wbartels »

  1. Enable $cfg['php_info'] in the config.inc.php file.
  2. Open netjukebox > Config > PHP information.
  3. See previous post.
adink
User
Posts: 6
Joined: Wed Jan 02, 2019 4:06 pm

Re: failed to open directory...

Post by adink »

Oh! ok, I see it now. My bad thanks again.
adink
User
Posts: 6
Joined: Wed Jan 02, 2019 4:06 pm

Re: failed to open directory...

Post 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.
Locked