markswift Posted April 17, 2015 Report Share Posted April 17, 2015 Hi Guys, I have the latest version of Uniserver ZeroXL installed and running. I've transferred across from XAMPP and I wanted something lighter and less bloated. The only issue I'm having is that one of my PHP scripts relies on curl and GD to pull images from my IP camera, sadly I cannot get this to work using Uniserver - it works fine with the default install of XAMPP. The message displayed is attached, I've also ensured that both curl and GD are ticked under PHP modules. Any help getting this resolved would be greatly appreciated, I've spent hours googling around and trying various things with no luck... I also tried the following code in check.php and it just displays a blank page. <? // is curl installed? if (!function_exists('curl_init')){ die('CURL is not installed!'); } // create a new curl resource $ch = curl_init(); echo "OK"; ?> SecureImageDisplay.php Quote Link to comment Share on other sites More sharing options...
Ric Posted April 17, 2015 Report Share Posted April 17, 2015 The above example code will not work because you are using short PHP tags Uniform Server defaults to using full PHP tags. The following examples show curl and gd operation on a default installation 11_7_4_ZeroXI curl example save as file z2.php $image_url = "http://www.uniformserver.com/ZeroXI_documentation/common/images/us_zero_logo.png"; $ch = curl_init(); $timeout = 0; curl_setopt ($ch, CURLOPT_URL, $image_url); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); // Getting binary data curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); $image = curl_exec($ch); curl_close($ch); // output to browser header("Content-type: image/png"); print $image; ?> gd example save as file z3.php header("content-type: image/png"); $src_img = imagecreatefrompng("images/logo.png"); $srcsize = getimagesize("images/logo.png"); $dest_x = $srcsize[0] / 2; $dest_y = $srcsize[1] / 2; $dst_img = imagecreatetruecolor($dest_x, $dest_y); imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $dest_x, $dest_y, $srcsize[0], $srcsize[1]); imagepng($dst_img); imagedestroy($src_img); imagedestroy($dst_img); ?> To run type http://localhost/z2.php and http://localhost/z3.php All the best Ric Quote Link to comment Share on other sites More sharing options...
Lee Davis Posted July 21, 2017 Report Share Posted July 21, 2017 The above example code will not work because you are using short PHP tags Uniform Server defaults to using full PHP tags. The following examples show curl and gd operation on a default installation 11_7_4_ZeroXI curl example save as file z2.php <?php $image_url = "http://www.uniformserver.com/ZeroXI_documentation/common/images/us_zero_logo.png"; $ch = curl_init(); $timeout = 0; curl_setopt ($ch, CURLOPT_URL, $image_url); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); // Getting binary data curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); $image = curl_exec($ch); curl_close($ch); // output to browser header("Content-type: image/png"); print $image; ?>gd example save as file z3.php <?php header("content-type: image/png"); $src_img = imagecreatefrompng("images/logo.png"); $srcsize = getimagesize("images/logo.png"); $dest_x = $srcsize[0] / 2; $dest_y = $srcsize[1] / 2; $dst_img = imagecreatetruecolor($dest_x, $dest_y); imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $dest_x, $dest_y, $srcsize[0], $srcsize[1]); imagepng($dst_img); imagedestroy($src_img); imagedestroy($dst_img); ?>To run type http://localhost/z2.php and http://localhost/z3.php All the bestRic Is there some set of instructions which CLEARLY state how to activate that can be found ANYWHERE? It's probly me, but I've read every question where there was difficulty with enabling the module, and that stock answer about downloading from PHP.net the same module of PHP as the Uniform Server is about as useful to me as breasts on a man. Can I get a clearcut pointer to some current information? PLEASE?!?!?!?!? Quote @Promodrone Link to comment Share on other sites More sharing options...
Lee Davis Posted July 27, 2017 Report Share Posted July 27, 2017 As it turns out...Google IS your friend in this case (lol!). Using the query "curlopt_cainfo option. Uniform Server", I was able to find a clue to my cURL dilemma, as well as anticipate for when I need access to the SSL extension for soon-to-come development. I've changed both the dev and production PHP ini files as I'm not sure which one is the default (posited the dev version, since I'm not using my box as an IIS platform). https://sorastation.com/tmp/JoomlaPC33/core/php54/php_production.ini - jarred loose confusion for me. Just seeing it laid out in front of me, led me to resolve this logjam myself, HTHSO. Quote @Promodrone Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.