Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3980126
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:15:13+00:00 2026-05-20T05:15:13+00:00

I have created a script in which a i have to create a image

  • 0

I have created a script in which a i have to create a image at runtime using a 64bitencoded string .i m using imagecreatefromstring function of PHP but it works in my Windows XAMPP based PHP , but not on my cloud side applications which i deployed on Amazon cloud running SUSE version of Linux.

Can u give me any suggestion to overcome the problem.
Or is there any other function which is capable to create the image from the encoded string passed to it.

Thanks in adv

I am using following code

<?php
         require ('../dbconfig/dbConfig.php');

    $gameId = $_POST["gameId"];
    $username = $_POST['email'];
    $imagedata =  $_POST['imagedata'];

    $uploaddir = './../blogdata/i/'; 

    $countSql =  mysql_query("select  max(_id) as fileName  from blog_data ");

    while($rowCommentData = mysql_fetch_assoc($countSql))
    {
        $num = $rowCommentData["fileName"];
        $file = ++$num.".png";
        $filedb = $uploaddir .$file;
    }


   /* $imagedata= 'iVBORw0KGgoAAAANSUhEUgAAABwAAAASCAMAAAB/2U7WAAAABl'
               . 'BMVEUAAAD///+l2Z/dAAAASUlEQVR4XqWQUQoAIAxC2/0vXZDr'
               . 'EX4IJTRkb7lobNUStXsB0jIXIAMSsQnWlsV+wULF4Avk9fLq2r'
               . '8a5HSE35Q3eO2XP1A1wQkZSgETvDtKdQAAAABJRU5ErkJggg==';*/

    $imagedata= base64_decode($imagedata);

    if(($img = @imagecreatefromstring($imagedata)) !== FALSE) 
    {

            if(imagepng($img,$filedb))
            {       
                    imagedestroy($img);

                    $sql="Insert into blog_data (game_id,text,type,username)".
                                   "Values('$gameId','$file','i','$username')";

                    $result=mysql_query($sql);

                    if($result == 1)
                    {
                        echo $file; 
                    }
                    else
                    {
                        echo "error2";
                    }
            } 
            else {
                echo "error1";
            }               
                   }
    else
    { 
         echo "error0";
    }

?>

By running PHP info there i got this information
enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T05:15:13+00:00Added an answer on May 20, 2026 at 5:15 am

    The PHP needs to have the libgd extension installed and loaded. Check phpinfo() if it’s there. You probably can install it via yum. The package should be called php5-gd

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP script that uses GD2 to create an image. It uses
I have the following simple script, which I am using to dynamically create the
I have an SQL script which creates a scheduled event: CREATE EVENT Daily_1200PM SCHEDULE
I have a PHP script which creates and listens on a port for connections
I have created a script which is surprisingly working. (I do not do much
I have a ajax image upload script which i found here http://www.fengcool.com/2009/06/ajax-form-upload-local-image-file-without-refresh/ The problem
I have a file upload script that works [finally] but want to have users
I have a script which uploads an image to the server under the id
I have a JQuery script which acts as a simple image rollover with a
i have created a gallery script, which first loads images to be shown http://bit.ly/9aQdr3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.