Images not uploading

Open to all! Ask other shopowners for help.
Post Reply
Dan Cole
Senior Contributor
Posts: 498
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Images not uploading

Post by Dan Cole »

I have a new install of Phoneix 1.1.0.6 and for reasons that are lost on me I can't upload new product images. Setting things up to output error messages gives me this...

Code: Select all

Warning: move_uploaded_file(/home/aquarsupplies/public_html/phoenix/images/AI-ac-100-communication-cable.jpg): Failed to open stream: No such file or directory in /home/aquarsupplies/public_html/phoenix/XXXadminXXX/includes/classes/upload.php on line 68

Warning: move_uploaded_file(): Unable to move '/tmp/phpqux4AZ' to '/home/aquarsupplies/public_html/phoenix/images/AI-ac-100-communication-cable.jpg' in /home/aquarsupplies/public_html/phoenix/XXXadminXXX/includes/classes/upload.php on line 68
The directory permissions images directory are set to 755 which works on my live site that is located on the same server. Can anyone point me in the right direction? The file name does end up in the images directory but the file size is set to 0.

Dan


Join The Code Co-op to get access to your library in the Code Co-op Forum
BrockleyJohn
Certified Developer
Posts: 173
Joined: Mon Mar 01, 2021 5:37 pm
Phoenix Version:
Has thanked: 2 times
Been thanked: 30 times

Re: Images not uploading

Post by BrockleyJohn »

I think it's saying it can't find the tmp file. This probably means it's not getting uploaded.
- check the values of post_max_size and upload_max_filesize for php running in your test store
- have you got an addon that could be messing with the form in admin > catalog? Losing the enctype would do this

You can test the assertion by checking tmp file existence and logging the result before move_uploaded_file
User avatar
burt
Core Team
Posts: 4550
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Images not uploading

Post by burt »

My immediate thought was along the same lines as John.

The (I assume AI created?) image is too large (in MB) for your PHP version to handle...

IE, your max filesize might be set at 2MB and the image might be bigger.
I am not here to build for you.
I am here to build with you. Let's help each other.
Dan Cole
Senior Contributor
Posts: 498
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Re: Images not uploading

Post by Dan Cole »

Thanks for the responses guys. I dug a little deeper based on your input and I don't think file size is an issue....my php.ini file has the post_max_size and upload_max_filesize both set to 500M and the product images I tried to upload (I tried many different ones) were for the most part less than 100KB...there were a few slightly over that but all what I would consider to be very small files.

In answer to the question about whether I had an add-on installed that might interfere with the upload, it is a clean install from the Softaculous c-panel. Thinking that a file might have gotten corrupt during that process I did another completely clean install and unfortunately the issue persists. This leads me to believe that the download itself from Softaculous is to blame or it has something to do with my hosting account. I won't rule out a hosting issue just yet but since both my live site and now older test site both work fine in the same environment, just in different directories, I doubt that is the issue. That leaves me wondering about the Softaculous install. I'm guessing that others have installed 1.1.0.6 from there without problems but I might just pull a copy from github and see how that goes unless anyone can suggest other options before I do so?

Dan
User avatar
burt
Core Team
Posts: 4550
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Images not uploading

Post by burt »

Compare the two configure file paths. The `live` one might have different DI_FS_ and DIR_WS_ paths to the new one. Make the new one match as close as possible..
I am not here to build for you.
I am here to build with you. Let's help each other.
Dan Cole
Senior Contributor
Posts: 498
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Re: Images not uploading

Post by Dan Cole »

Thanks Gary....I compared the configuration files side by side (live site vs new 1.1.0.6) and they look the same other than the necessary differences in folder names. I think it might be time to take a run at installing a test site from a direct download here. I'm out of other ideas.

Dan
Dan Cole
Senior Contributor
Posts: 498
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Re: Images not uploading

Post by Dan Cole »

@burt@BrockleyJohn

I'm still in the weeds here. I found a bit of time to download the latest version of Phoenix from here on the forums and then uploaded it and copied over the configure files but unfortunately I still have the same issue. I'll probably tap my host next but I'd like to define the problem a little better before I do so. In that regard I decided to output some of the variables that seem to be in play when the move_uploaded_file() is called. Here is what I'm seeing at that point.

Code: Select all

destination: /home/aquarsupplies/public_html/PH16/images
filename: buy-more-save-more.png
permissions: 511
Array ( [0] => png [1] => gif [2] => jpg [3] => jpeg [4] => svg [5] => webp ) extensions: 1
Array ( [name] => buy-more-save-more.png [type] => image/png [size] => 19962 [tmp_name] => /tmp/phpozpryE ) file: 1
tmp filename: /tmp/phpozpryE
file temp name: /tmp/phpozpryE
I don't see anything out of the ordinary here but maybe someone can spot the issue or suggest other variables or output I could try that would produce some sort of clue. Here's hoping.

Dan
User avatar
burt
Core Team
Posts: 4550
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Images not uploading

Post by burt »

/home/aquarsupplies/public_html/phoenix/images/

/home/aquarsupplies/public_html/PH16/images/

I wonder which is correct?
I am not here to build for you.
I am here to build with you. Let's help each other.
Dan Cole
Senior Contributor
Posts: 498
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Re: Images not uploading

Post by Dan Cole »

The PH16 is....my first post included the warning messages from the original site before I re-installed Phoenix again. The original install used the directory phoenix and the new install uses PH16 for the directory.

Dan
Dan Cole
Senior Contributor
Posts: 498
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Re: Images not uploading

Post by Dan Cole »

I thought I would update this thread. I finally got this working. I asked Gemini for help, and we added several error checks and coding changes to the upload class. This ensured that the file names and directories were correct and had the necessary permissions and then it suddenly started to work. I'm not exactly sure what solved it but I now have an updated class that addresses whatever the issue was and improves error checking within that code. Another win for AI. Woot, woot.

Dan


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply