Solved

Not adding images to database not creating pages

Posted on 2014-12-04
9
84 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

747 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