Jump to content
php.lv forumi

PHP4 problēma?


anonīms

Recommended Posts

Super problēma. Gatavs produkts tiek nodots pasūtītājam, bet izrādas, ka viņam gan konfigurācija, gan pats serveris ir mēsls.

uz php5 (2 hostingiem mēģināts) viss iet perfekti, bet redz šiem, augšuplādējot bildi vnk neizmet ne erroru, pilnīgi neko (to ieslēgšana ar nelīdz)

 

kods tiek līdz šaj funkcijai un tālāk apstājas

   function load($filename) {


     $image_info = getimagesize($filename);
     $this->image_type = $image_info[2];

     if( $this->image_type == IMAGETYPE_JPEG ) {
        $this->image = imagecreatefromjpeg($filename);
     } elseif( $this->image_type == IMAGETYPE_GIF ) {
        $this->image = imagecreatefromgif($filename);
     } elseif( $this->image_type == IMAGETYPE_PNG ) {
        $this->image = imagecreatefrompng($filename);
     }
  }

 

kur varētu būt problēma? kods par spicu priekšs php4 (man tā neliekas) ;/

Link to comment
Share on other sites

Tur tā lieta, ka nav ko atrast.

Es pat speciāli pamēģināju augšupladēt tīri jpg failu, btw

Array ( [0] => 1280 [1] => 1024 [2] => 2 [3] => width="1280" height="1024" [bits] => 8 [channels] => 3 [mime] => image/jpeg )

 

pārrakstīju arī funkciju vnk uz

function load($filename)
{
$this->image = imagecreatefromjpeg($filename);
}

bet tāpat nekā.

Link to comment
Share on other sites

Nezinu vai šoreiz, bet ar JPG bildēm ir pieredze, ka nepietiek PHP rezervētās atmiņas, jo JPG ir saspiests fails, kas, izsaucot getimagesize(), tiek atspiests. Nokonvertē pats to bildi, uz kuru uzkārās, par BMP un ieraudzīsi reālo bildes izmēru atmiņā, tad paskaties, vai PHP pietiek atmiņa to izdarīt?

Link to comment
Share on other sites

Warning: imagesx(): supplied argument is not a valid Image resource in /usr/local/www/.../application/controllers/IMGupload.php on line 64

 

Warning: imagesy(): supplied argument is not a valid Image resource in /usr/local/www/.../application/controllers/IMGupload.php on line 67

 

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /usr/local/www/.../application/controllers/IMGupload.php on line 86

 

Fatal error: Call to undefined function: imagejpeg() in /usr/local/www/.../application/controllers/IMGupload.php on line 44

Link to comment
Share on other sites

īsti nezināmu iemeslu dēļ kods ir aizgājis drusku tālāk.

Tagad vēl lielākas acis.

Fatal error: Call to undefined function: imagecreatefromjpeg() in /usr/local/www/.../application/controllers/IMGupload.php on line 32

Kādā sakarā var neeksistēt šī funkcija, ja viņa ir php4/5

 

EDIT:

Configure Command './configure' '--with-mysql=/usr/local/mysql' '--with-apache=../apache_1.3.34' '--with-gd' '--with-zlib' '--with-gettext'
Edited by anonīms
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...