VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Products, Prices, Tax and Categories VM 1.1 => Topic started by: rgibbs421 on November 30, 2009, 15:35:58 pm

Title: SOLVED:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: rgibbs421 on November 30, 2009, 15:35:58 pm
Okay guys I've been using virtuemart for about a year now and set up 4 or 5 stores. I have ran into two problems I absolutely have no clue on how to fix them. The biggest one is on one of the sites when I try to add additional images to the product I get 20 pages worth of php permission errors. The errors are below. I just grabbed the top two of them for an example. I have already chmod everything to 777 just to see if it would fix it but it did not. I figured I would post here to see if I couldn't get any help on the matter.

The next question I had was over the administrative products list search... Every virtuemart I have ever set up that function does not work... is it supposed to? Is there something that I need to install that makes that functional?


Warning: opendir(//root) [function.opendir]: failed to open dir: Permission denied in /home/toyfarm/domains/toyfarmusa.com/public_html/administrator/components/com_virtuemart/classes/ps_main.php on line 1144

Warning: readdir(): supplied argument is not a valid Directory resource in /home/toyfarm/domains/toyfarmusa.com/public_html/administrator/components/com_virtuemart/classes/ps_main.php on line 1146

Title: Re: Additional images
Post by: PRO on November 30, 2009, 16:23:30 pm
are all directories set to 755, and files to 644?

Whats the max upload size set to?

Title: Re: Additional images
Post by: rgibbs421 on November 30, 2009, 16:29:30 pm
2M
Title: Re: Additional images
Post by: rgibbs421 on November 30, 2009, 16:36:37 pm
2M
I am going to move this up to ten... I think it was unlimited on the test server that i set the site up on and was giving the same errors but im emailing the vps the site is set on and moving the size up...
Title: Re: Additional images
Post by: rgibbs421 on November 30, 2009, 16:46:25 pm
I have also double checked the permissions in the administrative components com_virtuemart directory and the components com_virtuemart and all the files are 644 and the directories to 755... all were correct. Do I need to check permissions other then those locations. 
Title: Re: Additional images
Post by: PRO on November 30, 2009, 16:57:42 pm
have you increased your mem limit?

Title: Re: Additional images
Post by: rgibbs421 on November 30, 2009, 17:51:14 pm
I have followed the instructions given to me by the vps support desk and joomla is reporting no change so I am still working on that.
Title: Re: Additional images
Post by: rgibbs421 on November 30, 2009, 18:55:04 pm
Okay this is strange. If i go to http://www.toyfarmusa.com/phpinfo.php then the php is set to 10m so its changed but the system info under help -> system info still says two megs... But yes it is changed. I am not sure if the differences between configuration displays there would have anything to do with this issue or not.
Title: Re: Additional images
Post by: PRO on November 30, 2009, 19:23:23 pm
I have had some things show different in the info tab as well
Title: Re: Additional images
Post by: rgibbs421 on November 30, 2009, 21:12:10 pm
So does any one have any other ideas why the additional images window would be displaying permission errors if all the permissions are set for files at 655 directories at 755 and the max uploads are at 10M
Title: Re: Additional images
Post by: PRO on November 30, 2009, 21:19:03 pm
try and replace   ps_main  to see if the file is corrupt
Title: Re: Additional images
Post by: rgibbs421 on November 30, 2009, 21:39:09 pm
I downloaded VM just a few minutes ago extracted it enough to get out ps_main saved a backup and then replaced it with a fresh one. Did not change outcome. I did notice something though while looking at the errors. All the errors are coming from ps_main line 1144, 1163, or 1146.
And the failed opendir command causing the error is trying to open some odd directories exmples are

(//var/lib/mysql/mma_i193php)
(//var/lib/mysql/andreama_cms)
(//var/lib/mysql/sab_phpbb1)
(//var/lib/mysql/grushenka_iadvan)
(//var/lib/mysql/jennsjou_i974wor)

which really just looks like some kind of name generator or something. This is where I get lost...
Title: Re: Additional images
Post by: PRO on December 01, 2009, 00:51:13 am
^^^ where are those names at?
Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: rgibbs421 on December 01, 2009, 02:27:46 am
Those names are the dir names it is having problems opening and closing. For example the errors I posted at the start has

Warning: opendir(//root) [function.opendir]: failed to open dir: Permission denied in /home/toyfarm/domains/toyfarmusa.com/public_html/administrator/components/com_virtuemart/classes/ps_main.php on line 1144

Where it says (//root) are where those randomly generated names are showing up at and its like 1000 of them.... if I were to print the page out it would be like 50 pages of opendir and closedir php permission errors with randomly (im guessing) generated dir's... Should I make a screen shot of it?
Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: PRO on December 01, 2009, 03:23:07 am
(//var/lib/mysql/sab_phpbb1)


sab_phpbb1 ?    what is that? 
Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: rgibbs421 on December 01, 2009, 03:51:13 am
I do not know its just a randomly generated name I think. I made a text file containing all the errors so you can understand what I'm talking about.

http://toyfarmusa.com/images/errors.txt
Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: PRO on December 01, 2009, 13:42:04 pm

what are the permissions on the tmp directory?


Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: rgibbs421 on December 01, 2009, 15:10:10 pm
The tmp dir in the root of the site is 755
Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: PRO on December 01, 2009, 15:45:31 pm
this has got to be soomething sooo simple.


Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: rgibbs421 on December 01, 2009, 16:06:16 pm
Do you understand why randomly generated locations would be being created during this process? By understanding Why that is happening might help point me in the right direction. I do not mind diving into the code I just don't have a clue on where to dive. I checked out the Banquet tables pro... nice customizing there.
Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: rgibbs421 on December 01, 2009, 19:29:26 pm
So you thought of anything else?
Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: PRO on December 01, 2009, 19:32:01 pm
have you tried using CSV to do additional images?


Do you have csv improved?
Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: rgibbs421 on December 01, 2009, 19:49:15 pm
CSV is how I got all the products, prices, cats, and additional images there to start with... I can change it by going into the db and fixing it all but later when I am not the one taking care of the site I was wanting it so others can use the additional images option.
Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: rgibbs421 on December 01, 2009, 19:51:04 pm
I do not have csv improved though I just make the spreadsheet and then use another site I found that does csv to sql conversions.
Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: PRO on December 01, 2009, 20:41:35 pm
do any of the products at all have additional images?
Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: rgibbs421 on December 01, 2009, 21:09:52 pm
almost all of them
Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: rb on December 01, 2009, 21:40:44 pm
Do you get the same error if you change the "Upload to" choice?  For instance, on the Upload screen, if instead of choosing "Default Product Image path", try "Specify the file location" and see what message you get.
Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: rgibbs421 on December 02, 2009, 01:18:05 am
I can not make that choice since the errors are appearing before it. The errors appear on the page after clicking new on the additional images window. The only thing that shows up other then the errors is a file browse form at the top of the page that does not work.
Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: rgibbs421 on December 02, 2009, 01:38:09 am
I did do a csv convert to sql and in the past had problems with the id's. The id's were not auto incremental and there for was not adding id's to products and causing all kinds of problems but after solving that little issue I thought I had it fairly well figured out that the import was what was causing this issue. But since it is still happening obviously that was not it but here is the spread sheet of the files table structure just in case...  http://toyfarmusa.com/images/sqlstructure.xls
Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to ope
Post by: rb on December 02, 2009, 02:36:47 am
I was able to re-create your symptom.  Take a look at this (yeah, I know it sounds weird).

Admin->Configuration->Downloads tab->DOWNLOADROOT

Even if you don't have downloadable products, this field should have something like this in it for your site:

/home/toyfarm/domains/toyfarmusa.com/public_html/media/

If it's empty or says something like /root or has a directory to which you do not have permissions, it causes the "Add Additional Images" page to error out.

I found that when you indicated exactly when the error occurred.  I believe the problem is in the script:

administrator/components/com_virtuemart/html/product.file_form.php

It looks like this script looks in the specified Downloads directory regardless if you have downloadable products.

If this is your problem, then the easiest fix is to put a full path to a legitimate directory to which you have permissions in the DOWNLOADROOT field.
Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: rgibbs421 on December 02, 2009, 06:59:33 am
Dude that worked... Thank you, Thank you, Thank you. I have been trying to figure this one out for about two months now and still didn't have a clue. I would have never guessed it would have been something to do with the download able products. I can not say thank you enough. I also have a problem with the back end product list search not working... you got any ideas on that or should I go ahead and start a new thread for that question. Thank you again rb. And thank you to BanquetTables.pro for your efforts in helping me fix this issue... Did it ever cross your mind that that would have been the solution?
Title: Re: Additional images:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: PRO on December 02, 2009, 15:25:25 pm
no, but I knew it would be something sooo simple,,,, it always is
Title: Re: SOLVED:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: rgibbs421 on December 02, 2009, 15:45:11 pm
Yea I agree... one line errors seem to be code issues but 100's of errors... you know that is just setting some where.
Title: Re: SOLVED:Warning: opendir(//root) [function.opendir]: failed to open di
Post by: gaspy on December 04, 2009, 09:13:42 am
Just to let you know --- I had the exact same problem (apparently it happens just in 1.1.4??) and the fix worked perfectly.

Thank you!