Call to undefined function printer_list() - php

I'm getting Call to undefined function printer_list() cuz my php_printer.dll isn't working and in the error log I'm getting PHP Startup: Unable to load dynamic library.
c:/wamp64/bin/php/php5.6.31/ext/php_printer.dll
I searched the entire web for php_printer.dll that works with php 5.6.31 and I didn't find it, I'm working with wampserver 3.1 on windows 7 can anyone help?

Looking at the one issue on that git repo I see that gimjudge has complied these DLL's for 32 PHP only. Their reasoning being that until PHP7 the 64bit PHP versions were actually only experimental. PHP only became truly 64 bit as of PHP7.0
So to use this dll you would have to install the 32bit version of WAMPServer. Then you will probably have no problems activating this DLL.
You can download the 32bit version of WAMPServer 3 from here Its the backup repo and much easier to see what you are doing and which version you are downloading than the normal SourceForge repo.
Make sure you have backed up all you site(s) and databases before installing the 32bit WAMPServer.
However it is possible to install the 32bit AND 64bit WAMPServer on the same PC as the default folder names are different (C:\wamp or C:\wamp64) the Apache and MySQL service names are also different (wampapache or wampapache64) and (wampmysqld or wampmysqld64)
Although its not a good idea to start both at the same time as this will use a lot of memory for no good reason.

Related

PHP printing - Call to undefined function printer_list()

I am trying to use PHP's printer functions. But PHP gives an undefined function error. I am using PHP 7.2 so I looked for a php_printer.dll online but I only found for PHP 5.x. I copied it to PHP ext directory and added a line to my php.ini, restarted apache but it still is not working.
I wanted to be able to list all available printers on my network and choose one and print with it.
C:\xampp\php\ext\php_printer.dll
php.ini
extension=php_printer.dll
Here is my code
$ouput = 'Test print...';
$getprt = printer_list( PRINTER_ENUM_LOCAL | PRINTER_ENUM_SHARED );
$handle = printer_open(getprt['NAME']);
if($handle) {
echo "connected";
} else {
echo "not connected";
}
printer_set_option($handle, PRINTER_MODE, "raw");
printer_write($handle,$output);
printer_close($handle);
Looking at the one issue on that git repo (https://github.com/gimjudge/php) I see that gimjudge has complied these DLL's for 32 PHP only. Their reasoning being that until PHP7 the 64bit PHP versions were actually only experimental. PHP only became truly 64 bit as of PHP7.0
So to use this dll you would have to install the 32bit version of WAMPServer. Then you will probably have no problems activating this DLL.
You can download the 32bit version of WAMPServer 3 from here: http://wampserver.aviatechno.net/
Its the backup repo and much easier to see what you are doing and which version you are downloading than the normal SourceForge repo.
Make sure you have backed up all you site(s) and databases before installing the 32bit WAMPServer.
However it is possible to install the 32bit AND 64bit WAMPServer on the same PC as the default folder names are different (C:\wamp or C:\wamp64) the Apache and MySQL service names are also different (wampapache or wampapache64) and (wampmysqld or wampmysqld64)
Although its not a good idea to start both at the same time as this will use a lot of memory for no good reason.
(Credits RiggsFolly)

Wampserver gibin not a valid Win32 application with php 5.4

I replaced my 2.1 version of WampServer with the 3.1.4 64 bit version. Everything worked after the installation. But I need to have php 5.4 and that doesn't come with this version of WS. So I downloaded that version, made the changes to the various files as mentioned here and other places. But when I switch to 5.4 it doesn't start.
I ran the "Check State of Services" tool and it said this
State of services:
The service 'wampapache64' is NOT started EXIT error code:1066 Help
message for error code 1066 is: The service has returned a
service-specific error code.
The service 'wampmysqld64' is started
The service 'wampmariadb64' is started
The service 'dnscache' is started
WampServer (Apache, PHP and MySQL) will not function properly if any
service 'wampapache64' 'wampmysqld64' 'wampmariadb64' 'dnscache' is
not started.
And the "Check http.conf" tool said
httpd.exe: Syntax error on line 195 of
C:/wamp64/bin/apache/apache2.4.35/conf/ht tpd.conf: Cannot load
c:/wamp64/bin/php/php-5.4.9/php5apache2_4.dll into server: %1 is not
a valid Win32 application.
And line 195 of that file is
LoadModule php5_module
"${INSTALL_DIR}/bin/php/php-5.4.9/php5apache2_4.dll"
Is it failing because the dll file is for the wrong version or do to something else? I've tried to locate a php5apache2_4.dll file for 32 bit but I couldn't find one.
I've spent most of the weekend on this and if I can't get it going I will need to go back to my previous version since I work on more sites using 5.4 than later versions. I hope I don't have to do that.
If you are using WAMPServer 3 or greater then there are a multitude of versions of PHP that can be downloaded as ADDONS. In other words installed into WAMPServer with a simple download and click to install.
I suggest you remove the manually installed version of PHP and use the provided downloads.
They are available from SourceForgce, but they are a LOT EASIER to find on the WAMPServer backup repo
It looks like you may need to use the 32bit WAMPServer 3.1.4 as there does not appear to be a 64bit PHP5.4 available in the ADDON list.
You may also find that you need to download an older version of Apache to get PHP5.4 to run as Apache and PHP have to be installed to versions that are compatibly compiled.
But with WAMPServer 3 there are 16 versions of Apache and 50 or so versions of PHP.
EDIT: In answer to your comment
If you uninstall the 64bit WAMPServer (after backing up site code and any databases) and install the 32bit WAMPServer V3.1.4.
The version of Apache i.e. V2.4.35 that comes with WAMPServer3.1.4 will run PHP5.4.45. So once you have WAMPServer 3.1.4 installed and working (check it works before continuing) you can download and install the ADDON for PHP5.4.45
Then using the wampmanager menu, switch to PHP5.4.45.
The version of MySQL is not directly link to Apache/PHP so the version that comes with WAMPServer V3.1.4 will work just fine.
It would also be a good idea to apply the WAMPServer 3.1.5 upgrade to WAMPServer 3.1.4 so you are totoally upto date with WAMPServer

Trying to get imagick running on PHP 5.4.3 at Windows x64

I have Windows 7 64 bits, PHP 5.4.3 installed through WAMP 2.2 and imagick (ImageMagick-6.8.3-9-Q16-x64-dll.exe). I tried to use the php's dll of imagick from a lot of sources but all of them give this error in apache_error.log:
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_imagick.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0
Any thoughts on how to solve this?
perhaps this can help you:
step-by-step instructions for installing IMAGEMAGICK on WAMP?
and
http://www.elxsy.com/2009/07/installing-imagemagick-on-windows-and-using-with-php-imagick/
"Just to make things clear, all the PHP dll files (librarires) are 32 bit, so if your system is 64 bit and you will still need to download and operate 32 bit ImageMagick, Apache, etc."
I went through the same pain. Win64+php-x86. It ended up being something relatively simple to fix - it is all about paths.
I first had installed the full ImageMagic-x64, then eventually the extension. I later noticed that installer had appended ImageMagic in the beginning of the PATH.
Just in case I tried with the x86 version and got different errors about missing DLLs.
So, just in case I uninstalled ImageMagic completely and cleaned up all references to it from the environment (it was in the PATH and MAGICK_HOME).
Then I installed just the extension (in my case from http://windows.php.net/downloads/pecl/releases/imagick/3.1.2/ I got php_imagick-3.1.2-5.4-nts-vc9-x86.zip) and unpacked it in the ext folder.
The revelation came after I tried to run this from the command prompt: php -i and got an error that it could not find CORE_RL_wand_.dll - but I did see it in the ext folder!
Adding C:\Progra~2\PHP\EXT at the end of the PATH environment variable solved it (after making sure that there are no other DLLs interfering).
Note: I used the 8.3 path to "C:\Program Files (x86)\php\ext" - just in case as I've seen PHP being sometimes picky and unable to resolve paths with spaces in them.
Also - after messing up with the PATH you may have to reboot the PC - in my case it worked from a command prompt right away, but IIS had a cached (older) path.
In conclusion: I suspect the PHP extension relies on some DLLs (which it delivers as part of the ZIP) but the same ones are also part of the standard ImageMagick installation, except that the two are not exactly the same - if you happen to be loading the wrong ones fun things happen...
For a 64bit WAMP (PHP 5.4.x, PHP 5.4.12 thread safe in my case) a working combination is the following:
ImageMagick-6.8.7-8-Q16-x64-dll.exe or possibly latest Q16/x64/DLL from here: Link
and php_imagick-svn20120508-5.4-VC9-x64 from here: http://www.mediafire.com/php-win64-extensions

php_redis.dll not working in windows

I tried both the files from here: https://github.com/nicolasff/phpredis/downloads. I am using 64bit wampserver on windows 7 professional. It looks like apache is trying to load the file but somehow could not recognize it properly. This is what I see in the error log:
PHP Startup: Unable to load dynamic library
'D:/wamp/bin/php/php5.3.13/ext/php_redis.dll' - %1 is not a valid
Win32 application.
Anyone faced similar issues? Do we have a working solution for this?
Just in case it can help someone, I managed to solve the error on PHP 7.1.12 installing the 32 bits DLL.
I was getting the error:
Warning: PHP Startup: Unable to load dynamic library '.../php_redis.dll'
not a valid Win32 application
But after installing the 32 bits version, the warning disappeared.
To know which architecture of XAMPP/WAMP are you using, visit the phpinfo() and look for the value "Architecture", it was for me on the fourth row, and as expected is had the value x86.
I had to check the Server API from phpinfo() to decide which version to use
If It's
Apache 2.0 Handler(mod_php) go with Thread Safe version
If It's CGI go with Non Thread Safe version
Unfortunately I do not run 64-bit version of PHP to test this, but for PHP 5.3 you can try this dll.
Dll from https://github.com/nicolasff/phpredis/downloads ( php_redis-2.1.3-5.2-vc6-ts-4350b2a.zip ), is working fine with PHP 5.2.17 (32-bit version).
I hope you will solve the problem.
I used XAMPP x86 / PHP 7.2.5 so I needed redis x86 and the directory is this: C:/xampp/php/ext/.
https://pecl.php.net/package/redis/4.1.0/windows
I'll add my ansewer to the table :
I used those dlls for my AMPPS server (WAMP should be the same) under windows 8 with PHP 5.5:
https://pecl.php.net/package/redis/2.2.7/windows
following this tutorial
https://www.linkedin.com/pulse/using-redis-windows-php-shekhar-joshi
I had same issue for 64 bit windows 7 wampserver with PHP5.5.12
and worked for me from below link dll binaries of Redis
http://windows.php.net/downloads/pecl/releases/redis/2.2.7/
I had the same case, I was installing wamp 32bit, but I imported the library in 64bit however I had to imorted the 32bit version.
Check in the task manager which version of wamp you are using!
For me the reason was version of Redis PHP extension that I've been used.
xampp architecture: x64
php version: 7.4
php type: ts (thread safe)
redis version installed on windows: 3.0.504
and finally the version of Redis PHP extension that worked for me was:
for php 7.4
latest stable version: php_redis-5.3.4-7.4-ts-vc15-x64
I downloaded it from this Link

Installing ImageMagick Onto Xampp/Windows 7

ImageMagick is working when I test it from cmd but when using it for Xampp and restarting it then the error message I receive is:httpd.exe-Entry Point Not Found. The procedure entry point MagickGetImageGravity could not be located in the dynamic link library CORE_RL_wand_.dll.
The second message is PHP StartUp: Unable to load dynamic library C:\xampp\php\ext\php_imagick.dll- The specified procedure could not be Found.
I'm pretty sure second error message is caused by first error up top. Probably wrong dll. I'm on Windows 7 64 BIT running PHP 5.3.5 and Apache 2.2.17. Thanks
My refrence is this page
ImageMagick 6.8.0 binaries compiled with VC9 (Visual Studio 2008). I noticed that the official ImageMagick builds are now Visual Studio 2010 and that wouldn’t work well with PHP compiled with 2008. see phpInfo() and search for compiler and php version.
The download link for the binaries is here: imagick-php54-php53.tgz
I download this folder and copy php54 -> php_imagick_ts.dll to xampp\php\ext
My PhP Version is : PHP Version 5.4.4
then rename it to php_imagick.dll.
At the end restart your appache server.
I had this same problem and banged my head against all kinds of possible solutions before finally finding a combination of Imagick builds and dll's that would play nicely with my setup. Here's what finally worked for me:
OS: Windows 7 64 Bit
PHP: 5.5.6
XAMPP: 1.8.3
Compiler: MSVC11
Architecture: x86
ImageMagick: ImageMagick-6.7.7-5-Q16-windows-dll (available here)
Imagick DLL: PHP5.5.x version from http://www.peewit.fr/imagick/
Once I finally had this set up, Apache finally started without any errors. Hopefully it works for you, too!
I think there some problem loading imagemagick php module while you install latest version of windows binary ,i rectify the problem by download 6.7.7-5-Q16 32bit version and its worked on that version.once install this version download imagemagick PHP module and restart apache.

Categories