php-windows Digest 23 Nov 2008 19:26:46 -0000 Issue 3540

Topics (messages 29078 through 29079):

Re: return C++ string to PHP var?
        29078 by: Stut

PHP and Imagick Installation Issue
        29079 by: Sanjay Shah

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
On 14 Nov 2008, at 01:51, Albus Dumbledore wrote:
I have to create a data access layer (DAL) to be used in PHP. It looks like
writing a COM object and loading it from PHP would be the best bet.

Question 1: Is COM the best solution here?

COM would be one way to go, or you could write it as a PHP extension.

Question 2: if I had an interface "char* query("Blah")" How would I return
the result set into a PHP var?

If using COM just return it from the COM method as a bstr. COM/PHP will do what it needs to in order to give that to the caller as a PHP string.

Question 3: Anyone know of a good tutorial that creates a COM object and
accesses it via PHP?

Never seen one, it's not what you might call a "normal" thing to do. My friend Google knows a lot of stuff, it might know about this too.

-Stut

--
http://stut.net/

--- End Message ---
--- Begin Message ---
Hi,

I'm trying to use Imagemagick on windows with php and having trouble
getting it to work. Any help on what I might be missing or doing wrong
would be greatly appreciated. I've laid out below in detail the steps
I've already taken:

Background: I am running windows Vista, and have pHp 5.2.5 installed
and Apache v 2.2.8 installed

Step 1. Installed binary release imagemagick for windows, version:
ImageMagick-6.4.6-1-Q16-windows-dll.exe (Win32 dynamic at 16
bits-per-pixel) from
http://www.imagemagick.org/script/binary-releases.php (Imagemagick
seems to be working because the suggested test commands are working:
convert logo: logo.gif, identify logo.gif, imdisplay logo.gif)

Step 2. Downloaded php_imagick.dll from
http://pecl4win.php.net/ext.php/php_imagick.dll  (Downloaded version
for php-5.2.1).

Step 3. Copied php_imagick.dll file to five directories (copied into
multiple directories just to be safe):
Apache2.2\php\ext, Apache2.2\bin, Windows\system, Windows\System32,
C:\Program Files\ImageMagick-6.4.6-Q16

Step 4. Added extension=php_imagick.dll to php.ini

Step 5. Copied all .dll files frm C:\Program
Files\ImageMagick-6.4.6-Q16 into following directories (copied into
multiple directories just to be safe):
Apache2.2\php\ext, Apache2.2\bin, Windows\system, Windows\System32

Step 6. Added MAGICK_HOME as an environment variable pointing to
C:\Program Files\ImageMagick-6.4.6-Q16

Step 7. Ran the following script to test whether imagick was working:

<html> <head> <title>Test for ImageMagick</title> </head>
<body>
<?php
function alist ($array) {  //This function prints a text array as an html list.
  $alist = "<ul>";
  for ($i = 0; $i < sizeof($array); $i++) {
    $alist .= "<li>$array[$i]";
  }

  $alist .= "</ul>";
  return $alist;
}

exec("convert -version", $out, $rcode); //Try to get ImageMagick
"convert" program version number.
echo "Version return code is $rcode <br>"; //Print the return code: 0
if OK, nonzero if error.
echo alist($out); //Print the output of "convert -version"

?> </body> </html>

Step 8. Got the following result in browser:

Version return code is 1

Version: ImageMagick 6.4.6 2008-11-21 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC


It looks like Imagick is not working, else the version return code
above should have been 0. Any help would be greatly appreciated!!

--- End Message ---

Reply via email to