I need a very big help and is urgent. I have a big "permission" problem when i run this module and I get ths errors:

Warning: fopen(tmp/::name.hsh) [function.fopen]: failed to open stream: Invalid argument in ...

Warning: fwrite() expects parameter 1 to be resource, boolean given in...

Warning: fclose() expects parameter 1 to be resource, boolean given in ...

The code is

     if (!file_exists($File)) {
    $Handle = fopen($FileHash, 'w');
    fwrite ($Handle, $audio_hash.$LINE_BRK);
    fwrite ($Handle, $playlist.$LINE_BRK);
    fclose ($Handle);
    $Handle = fopen($File, 'w');

As I understand sayes that cant write in temp folder because isnt writible. Its a module in Joomla.
I have run it in xamp under localhost and under real server but it is the same error. At xamp joomla sayes that logandtemp directories are writible but at real server sayes they are not writable.

With the standard procedure i have given permissions 756 and 777 but i still get thesame error. The path for tmp folder is regular as i can see. All my effords are useless and cant see why fopen doesnt open the tmp folder when the path is ok. is it the problem in xamp or server instead of the code or is the code.

Why the 756 and 777 permissions doesnt have effects in xamp and server with joomla?

Any advice about permissions for fopen and xamp server or joomla permissions and how the path should look, are welcome. Thanks.

Recommended Answers

All 11 Replies

if you are running xampp on windows, there is no permission requirement (most of the time), but in linux CHMOD is a requirement, even if you are running your application as root.

I just notice on your error notification


it has Scope Resolution Operator (::), is it part of joomla syntax? or it just got there by accident?

yes is module for joomla and is part of joomla...a tmp folder...also i put it on server but was the same problem...cant run because fopen cant open the tmp folder which is in joomla

ok, on your joomla administration panel, does it have any permission settings option for the tmp directory?

Hold on le me run a joomla on my thumb server... let me see..

under site...system information...directory permissions ...permissions can bee seen
-when I run it under xamp as you sayed I dont need permissions and when i see tmp folder permissions are set writable but I get that error from above
-when i put it on linux server and see...permissions are nonwritable for temp and log folder and when i set the permissions at 756 or 777 in c panel...the result in joomla system informations is still nonwritable...the change doesnt affect

-anyway because I get the same error also in xamp under windows I am not sure if the permissions are the problem for the error...somehow the code cant acces the tmp folder or something similar

ok, I could see it in my thumb server (both apache and nginx are displaying the same).. in the system information it is writtable.

Did you try connecting to your server using an FTP application like fileZilla?

Try connecting to your remote server using FTP appliance, and then right click on the tmp directory, click on file permission, set the permission to 0777 or 777 ..

Most servers running on Apache module as server API, they require to have 0777 or 777. However, servers running on su, fast CGI, CGI server API would allow 0755 or 755.

The loosy CHMOD is 777, so for testing purposes I think 777 is fine regardless if it is fast CGI or Apache module. However, for production site server API file permission recommendation should be followed at all times.

If you don't mind me asking, which module are you trying to install? is it an open source where we can do the testing also?, or it is propriety module?

i did with fzilla too and with c panel i changed to like 777 but was unwritable still
But in xamp i dont need the permissions but I still get the error and the path is ok.
yes is free but all dont have the problem...is jbgmusic mod...


ok, the permission problem is coming from the default template..By allowing the Atomic to default, creates problem in CHMOD or inability to write, even-though the /tmp directory is writtable.

You will have asked the publisher which template this module supports.

For some reason, overriding is not allowed and that would violate his TOS..

oh thanks a lot I will try contact him...I tried with several different templates too but no succes...interesting bug :)

yep templates are making problems...I tried with defaults beez2 andhathor templates and i had one succesfull music start but when i pressed other menu i got the same crash

That sucks dude, every time joomla release a new versions, it keeps on getting bigger and bigger. Their latest release is about 158MB on the disc, That is a huge load for simple corporate or publication websites. Unless, there are some really good features you cannot write in php, then I guess joomla is the choice.

However, if you will be creating a simple blog, or content management of some type you can easily write them in PHP. I was a big fan of these people e.g. joomla, wordpress and many other framework. Then I came to realized that their purpose behind all these, is to put everyone in the box, until nobody would ever think outside of this box they have created. The price we have to pay are our own ability to create, innovate, explore new ideas, and to be able to attain our maximum potential we possesed since birth. That reminds of "Allegory of the Cave" or the "Parable of the Cave".

Adding a background music to a page that loops is not that hard. If you will not be creating a publication sites like the time.com or forbes.com, I think a simple lightweight platform should be sufficient. For example, with minimal knowledge of PHP, MYSQL, SMARTY template engine, you can easily create an ultra lightweight application using the bootstrap. Bootstrap gives you every possible configuration of your site's design. Then just write the php part that will utilize the bootstrap via smarty template engine. Sometimes, thinking outside the box leads to new things being discovered and that is priceless and extremely self rewarding. But then again, I guess it is just me who would think this way.

Yep making the player is one line code ...cant realize why is that problematic for joomla...and why these templates resist many important features...what is the benefit for the people without php knowledge if they cant use joomla properly

thanks a lot for your advices !

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.