Problem with uploading images

4 views
Skip to first unread message

Jens Wedin

unread,
Oct 4, 2009, 2:37:34 PM10/4/09
to Magic Fields
I moved the thread from the blog to here instead.

I still have problem with this.
I made the change on line 12 in phpthumb.php but now I get another
error.
I run my dev site on MAMP with php 5.2.5. Could that be a problem?

-------
Notice: Use of undefined constant ’E_DEPRECATED’ - assumed
'’E_DEPRECATED’' in /Users/jens/Sites/chwisgi-dev/wp-content/plugins/
magic-fields/thirdparty/phpthumb/phpThumb.php on line 12

Warning: Cannot modify header information - headers already sent by
(output started at /Users/jens/Sites/chwisgi-dev/wp-content/plugins/
magic-fields/thirdparty/phpthumb/phpThumb.php:12) in /Users/jens/Sites/
chwisgi-dev/wp-content/plugins/magic-fields/thirdparty/phpthumb/
phpThumb.php on line 335
----------

Earlier discussion from the blog below.

Me:
------------
@hunk: The file are uploaded to the correct folder (for me uploads)
but I seem to get an error in one of the phpthumb files, phpThumb.php.
See error below.

Notice: Use of undefined constant E_DEPRECATED – assumed
‘E_DEPRECATED’ in /Users/jens/Sites/chwisgi-dev/wp-content/plugins/
magic-fields/thirdparty/phpthumb/phpThumb.php on line 12
------------

Hunk:
-----------
change the line 12 of the phpThumb.php (wp-content/plugins/magic-
fields/thirdparty/phpthumb)
error_reporting(E_ALL & ~E_DEPRECATED);
for this
if (defined(’E_DEPRECATED’)) error_reporting(E_ALL & ~E_DEPRECATED);
else error_reporting(E_ALL);
------------
E_DEPRECATED is one new error level of php 5.3
http://php.net/manual/en/migration53.deprecated.php

with the change it will have to work correctly

Harris

unread,
Oct 4, 2009, 3:02:54 PM10/4/09
to Magic Fields
Jens,
the warning "can not modify header" it is usually caused by a blank
line after the closing PHP tags.
Check your document to see if you have left a blank line while
editing.
e.g.
?>
blank line
<?php>

Or at the end of the document:
?>
blank line

Harris
> E_DEPRECATED is one new error level of php 5.3http://php.net/manual/en/migration53.deprecated.php

Karl Kevilus

unread,
Oct 4, 2009, 3:23:11 PM10/4/09
to magic-...@googlegroups.com
I had some similar errors on XAMPP, check your code for strange ASCII characters.

I'm reloading from original to see if I can recreate it, don't remember where it was.

K

David

unread,
Oct 4, 2009, 3:35:10 PM10/4/09
to Magic Fields
Oks, i think to i got the error. Edgar give to you this:

if (defined(’E_DEPRECATED’)) {
error_reporting(E_ALL & ~E_DEPRECATED);
}else{
error_reporting(E_ALL);
}

This have a detail, in the condition where you check if is defined
E_DEPRECATED you need check the CONSTANT and there is checking if is
defined a string... so try this:

if (defined(E_DEPRECATED)) {
error_reporting(E_ALL & ~E_DEPRECATED);
}else{
error_reporting(E_ALL);
}

And now should be work fine.

Jens Wedin

unread,
Oct 4, 2009, 4:13:01 PM10/4/09
to Magic Fields
Hi all and thanks for the help.
I have updated the code, looked for space in the beginning and end of
the file but luck. I now get

------
Notice: Use of undefined constant E_DEPRECATED - assumed
'E_DEPRECATED' in /Users/jens/Sites/chwisgi-dev/wp-content/plugins/
magic-fields/thirdparty/phpthumb/phpThumb.php on line 12
**Headers already sent in file "/Users/jens/Sites/chwisgi-dev/wp-
content/plugins/magic-fields/thirdparty/phpthumb/phpThumb.php" on line
"12", dumping error message as text:**

phpThumb() v1.7.9-200805132119

Headers already sent (phpThumb.php line 449)
------

David

unread,
Oct 4, 2009, 5:40:09 PM10/4/09
to Magic Fields
oks, i was wrong, i review more in deep and i think the solution of
Edgar should work.

I review how is fixed this issue in another projects, and in cakephp
doing something like this (http://code.cakephp.org/source/cake/
bootstrap.php):

if (!defined('E_DEPRECATED')) {
define('E_DEPRECATED', 8192);
}

error_reporting(E_ALL & ~E_DEPRECATED);


So , put that instead of the Edgars Code, and that this time should
work.

David.

Jens Wedin

unread,
Oct 5, 2009, 1:27:11 PM10/5/09
to Magic Fields
Thanks, now it works nicely :D

/Jens
Reply all
Reply to author
Forward
0 new messages