I had no problem with this code on my school's server, but when I moved it to mine it didn't work at all. Before it would make an image and display the text where I wanted it to, but now if Firefox all it does it display the full URL of the php file and IE displays a lil blank image box. I'm not sure what version the old server had, but mine has php 5.2.1. I copied over the whole folder, it's not like I'm missing a file there, but I'm wondering if it's just my PHP configuration, other PHP functions work fine. -
<?php
-
-
header("Content-type: image/png");
-
$string = $_GET['text'];
-
$im = imagecreatefrompng("MouseOver.png");
-
$black = imagecolorallocate($im, 0, 0, 0);
-
$white = imagecolorallocate($im, 255, 255, 255);
-
$px = (imagesx($im) - 10 * strlen($string)) / 2;
-
$font = imageloadfont("Occidental.gdf");
-
imagestring($im, $font, $px+1, 1+1, $string, $white);
-
imagestring($im, $font, $px, 1, $string, $black);
-
imagepng($im);
-
imagedestroy($im);
-
-
?>
8 1888
Does your php version have the gd library installed?
Does your php version have the gd library installed?
Not unless it's included in the standard full installation, how would I do that?
Atli 5,058
Expert 4TB
Find this line in your php.ini
and change it to
If your using apache you will have to restart it.
IIS isn't supposed to need a restart, but might.
That line wasn't there, I tried just adding it, but that didn't work. I'm using apache only and did a restart. I have no idea what's wrong.
Atli 5,058
Expert 4TB
What php version are you using?
Are you using Windows? If so did you install php with the installer?
If you did install php 5.x on windows using the installer, a .dll file will be missing from your installation.
Try downloading the zip version of the install from www.php.net and unzip it.
Find the ext folder in the unzipped folder and copy the php_gd2.dll to the ext folder in your current php directory. (C:/Program Files/PHP/ext/) by default
Then you will need to change / add the line as I showed you before and restart apache.
That should do it.
I'm using Windows, I tried using the installer, but it didn't seem to work so I left the files it made and used the zip version to include everything else. I checked my ext directory and the php_gd2.dll file is there.
Don't know if it help but you can check this out: PHP Info Atli 5,058
Expert 4TB
If the file is there and you have edited the php.ini it should show up.
Your phpinfo() shows the extension_dir as "./". You might have to find that in you php.ini and point it to the ext dir of your php installation.
Based on your phpinifo() file I'd guess (C:/Server/PHP/ext/)
And just be sure that you'r acctually editing the php.ini file that your phpinfo() refers to (C:\Server\PHP\php.ini). I've spent hours editing the wrong one, never understanding why it didn't work :P
extension_dir = "./ext"
That and uncommenting the
extension=php_gd2.dll
I figured it was "stock" going to work. Thank you Atli for your persistence, otherwise I probably would of tried reinstalling everything and came back to here.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: CMEDIA_SOUND |
last post by:
I have a peculiar problem,
I have a tabpage with a label control on it. When i set a background
image to the tabpage and drag the label around it has paint issues in
that it is slow, granted the...
|
by: nick |
last post by:
I have a problem and I've been using a cheezy work around and was
wondering if anyone else out there has a better solution.
The problem:
Let's say I have a web application appA. Locally, I set...
|
by: Pitcairnia |
last post by:
The basic purpose of the site is for authenticated users to post event
listings, which often include photographs. The user is faced with a page
where they can insert all of the information about...
|
by: IkBenHet |
last post by:
Hello,
I use this script to upload image files to a folder on a IIS6 server:
******************* START UPLOAD.ASPX FILE **********************
<%@ Page Language="VB" Debug="true" %>
|
by: Shawn Hamzee |
last post by:
Hello All,
I am having a problem with Image_Graph on php 5.1.4. I installed the package
and all of its dependencies through pear installer without any hitches. Then
I started to add some very...
|
by: Peter |
last post by:
I have a problem with a page show_image.asp that returns a jpg image under
Windows XP Pro SP2. The page sets content type as:
Response.ContentType = "image/jpg"
While this works perfectly fine...
|
by: MasterMax1313 |
last post by:
I'm trying to make a grid of picture box controls, which I do via code. Each of these boxes has a mouseclick, mousedown, mouseup, and mouseenter event. The mouseclick event is simple enough and works...
|
by: equazcion |
last post by:
Hi,
I have an image reference (IMG) in my page that changes depending on the value of a database field. Clicking the image triggers an Ajax call to change the database field (toggles the field...
|
by: helraizer1 |
last post by:
Hey folks, yet again.
if ($back == "m") //$back is a value pulled from a db; that works perfectly.
{
$wid = $rowing;
$hei = $rowing;
createthumb("660x240background2.gif", "./user/" ....
|
by: neovantage |
last post by:
Hey all,
I am using a PHP script which creates headings at run time in a sense at page execution. I am stuck a with a very little problem which i am sure i will have the solution from experts.
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |