Solved

Not adding images to database not creating pages

Posted on 2014-12-04
9
85 Views
Last Modified: 2014-12-09
Im having a problem with my small control panel where you add images to mysql then it creates a page for the images and data. It creates a entry in the database but it will not add the images. Below are some log files maybe someone could tell me why. I thought it was a permission sort of thing but I cant figure where. I change from one server where it was working to another where its causing this problem. I just cant figure out what the problem is.

/var/www/vhosts/my.com/httpdocs/admin/admin_model_photo_detail.php on
line 42, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Notice: Undefined
index: fileIcon in
/var/www/vhosts/my.com/httpdocs/admin/admin_model_photo_detail.php on
line 58, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Notice: Undefined
index: fileIcon in
/var/www/vhosts/my.com/httpdocs/admin/admin_model_photo_detail.php on
line 59, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Notice: Undefined
variable: HTTP_POST_VARS in
/var/www/vhosts/my.com/httpdocs/admin/admin_model_photo_detail.php on
line 106, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagecreatefrompng(../model_images/watermark.png)
[function.imagecreatefrompng]: failed to open stream: No such file or directory
in /var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 125,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagealphablending(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 126,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesavealpha(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 127,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesx(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 131,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 132,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagecopy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 135,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagedestroy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 138,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesx(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 42,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 43,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning: Division
by zero in /var/www/vhosts/my.com/httpdocs/include/resizeimage.php on
line 53, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image
dimensions in /var/www/vhosts/my.com/httpdocs/include/resizeimage.php on
line 83, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagecopyresampled(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 84,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagejpeg(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 85,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagedestroy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 46,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesx(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 42,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 43,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning: Division
by zero in /var/www/vhosts/my.com/httpdocs/include/resizeimage.php on
line 53, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image
dimensions in /var/www/vhosts/my.com/httpdocs/include/resizeimage.php on
line 83, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagecopyresampled(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 84,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagejpeg(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 85,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagedestroy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 46,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesx(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 42,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 43,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning: Division
by zero in /var/www/vhosts/my.com/httpdocs/include/resizeimage.php on
line 53, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image
dimensions in /var/www/vhosts/my.com/httpdocs/include/resizeimage.php on
line 83, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagecopyresampled(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 84,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagejpeg(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 85,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagedestroy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 46,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Notice: Undefined
variable: HTTP_POST_VARS in
/var/www/vhosts/my.com/httpdocs/admin/admin_model_photo_detail.php on
line 536, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
0
Comment
Question by:smphil
  • 4
  • 3
  • 2
9 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40481774
Looks like you were using an old version of PHP and you have now moved to a modern version where things like $HTTP_POST_VARS have been deprecated.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 40482040
You never want to add images to a database.  The reasons are many and complicated, but they will eventually hinder performance and backup.  Instead, store your images in the server file system and put the image URLs in the database.  If you want to tell us in a little more detail how this process is expected to work (at a high level - nothing technical, just what you have for input and what you want for output) we can probably suggest a reliable design pattern.
0
 
LVL 1

Author Comment

by:smphil
ID: 40484634
GARY
I think your correct the person who made the program is very behind the times what version of php do you think they are using to run this program. I guess I could could just run that version to get this thing working for the time being.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 40484637
Don't downgrade PHP.  You really, really, really want to refactor this code. To learn why, follow this link to the search results.  Old versions of PHP have as many holes as Swiss cheese.
https://www.google.com/search?q=php+security+vulnerabilities
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40484663
Do you have access to the php.ini file - if you do and you are on PHP v5.3 or lower then you can reenable things like HTTP_POST_VARS with

    register_long_arrays = On

Which will probably fix the other errors in the process.
0
 
LVL 1

Author Comment

by:smphil
ID: 40485667
Gary I am using V5.2.17  SHOULD I BE ABLE to change the things using the php.ini with that version.
0
 
LVL 58

Expert Comment

by:Gary
ID: 40485674
Yes
0
 
LVL 1

Author Comment

by:smphil
ID: 40485677
Gary so I should try turning on the register_long_arrays ?
0
 
LVL 58

Expert Comment

by:Gary
ID: 40485679
Yes
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MySql hide the stored procedures 2 38
Form Processing in PHP 11 30
mysqli 3 18
How do I call MySQL Stored Procedure from oracle using HS link ? 5 22
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now