PHP 5.4.7编译ext php_printer [英] PHP 5.4.7 Compiling ext php_printer
问题描述
我的知识库是,我可以在php。我从来没有使用C,C ++,C#或任何编译器。
我从使用php 5.3的XAMPP 1.7.3升级到1.8.1,包括:
Apache 2.4.3
MySQL 5.5.27
PHP 5.4.7
它正在安装在Windows 7 Pro,Windows XP Pro和Windows Server 2008 r2。
我升级了,因为我出于安全原因需要一个较新的Apache和MySQL版本。我没有降级选项。
我使用php_printer.dll可以将原始数据打印到打印机:
printer_set_option($ handle,PRINTER_MODE,RAW);
我的代码在PHP 5.3中运行良好,但在PHP 5.4中损坏。
收到错误后:致命错误:调用未定义函数printer_open()〜。我检查了php_error_log并收到以下信息。
PHP警告:PHP启动:打印机:无法初始化模块
使用模块编译的模块API = 20090626
使用模块API编译的PHP = 20100525
这些选项需要匹配
b $ b
我已经找了几个小时试图找到一个预编译php_printer.dll为PHP 5.4.7无效。我得出结论,我将必须从PECL中的源文件编译。 pecl.php.net/package/printer
从来没有做过任何互联网用户应该做的事情。我googled它,并在这里找到一些信息:
https://wiki.php.net/ internals / windows / stepbystepbuild
我花了一整天,但PHP构建工作。但后来试图创建php_printer.dll
首先我尝试:
svn co http://svn.php .net / repository / pecl / printer / trunk pecl / printer
但它说:
'svn'不被识别为内部或外部命令,可操作的程序或批处理文件。
所以我只是自己下载文件:
svn.php.net/repository/pecl/printer/trunk /
并将其放在:
C:\php-sdk\php54dev\vc9\x86 \php5.4-201303311430\ext\printer
我一定要从以下位置下载库:
windows .php.net / downloads / php-sdk / deps / vc9 / x86 /
也只是:
deps-5.4-vc9-x86.7z / p>
我尝试了一个,然后另一个;每次当我尝试nmake时,我收到以下信息:
c:\php-sdk\php54dev\vc9\\ \\ x86 \php5.4-201303311430> nmake
pre>
Microsoft(R)程序维护实用程序版本9.00.30729.01
版权所有(C)Microsoft Corporation。版权所有。
printer.c
ext\printer\printer.c(266):error C2065:'pval':undeclared identifier
UPDATE
。
由hackattack142»03.四月2013 23:51
Hello,
打开printer.c,将'pval'的所有实例替换为'zval',然后编译。
谢谢Hackattack,我希望更近一步。
c:\php-sdk\php54dev\vc9\x86\php5.4-201303311430> buildconf
〜
c:\php-sdk\php54dev\vc9\ x86 \php5.4-201303311430> configure --disable-all --enable-cli
--enable-printer
〜
c:\php-sdk\php54dev\vc9 \x86\php5.4-201303311430> nmake
Microsoft(R)程序维护实用程序版本9.00.30729.01
版权所有(C)Microsoft Corporation。版权所有。
internal_functions.c
printer.c
创建库Release_TS\php5ts.lib和对象Release_TS\php5ts.exp
创建库Release_TS\php.lib和对象Release_TS\php.exp
SAPI sapi \cli构建完成
编译。然而;我找不到printer.dll或php_printer.dll这是我希望的结果。
在 Release_TS\ext 文件夹中有一个名为打印机的文件夹。它包含以下文件:
printer.obj
printer.sbr
vc90.idb
I也是最后一步:
c:\php-sdk\php54dev\vc9\x86\php5。 4-201303311430> cd Release_TS
c:\php-sdk\php54dev\vc9\x86\php5.4-201303311430\Release_TS> php -m
[PHP模组]
核心
日期
ereg
pcre
打印机
反射
SPL
标准
[Zend模块]
c: \php-sdk\php54dev\vc9\x86\php5.4-201303311430\Release_TS>
来自其他论坛的帮助
configure --disable-all --enable-cli --enable-printer = shared
它工作,我创建了php_printer.dll但是当我试图使用它:
PHP错误日志:
[15-Apr-2013 15:34:53 UTC] PHP警告:PHP启动:无效的库(可能不是PHP库)'php_printer.dll'在未知中的行0
我不得不抓住5.4.7文件,因为我使用的是5.4.15,但XAMPP 1.8.1使用5.4.7
http://www.oldapps.com/php_programming_language。 php?old_php = 8227
并放入:C:\php-sdk\php54dev\vc9\x86\php-5.4 .7
然后将打印机文件放在ext文件夹中,并执行所有上述过程和:
configure --enable-printer = shared
它起作用了:
PHP版本5.4.7 php_printer.dll
http://pylonx.com/PHP/php_printer_5.4.7.zip
解决方案下载并安装任何你喜欢的php版本,并在这里安装相应的php打印机dll: http://windows.php.net/downloads/pecl/snaps/printer/0.1.0-dev/
My Knowledge base is, I can get around in php. I never worked with C, C++, C# or any compilers.
I Upgraded from XAMPP 1.7.3, which used php 5.3, to 1.8.1 which includes: Apache 2.4.3 MySQL 5.5.27 PHP 5.4.7
It is being installed on Windows 7 Pro, Windows XP Pro and Windows Server 2008 r2. But I am trying to get it to working on Windows 7 currently.
I upgraded because I needed a newer version of Apache and MySQL for security reasons. I do not have the option to downgrade.
I use the php_printer.dll for the ability to print raw data to the printer:
printer_set_option($handle, PRINTER_MODE, "RAW");
My Code worked fine in PHP 5.3 but broke in PHP 5.4.
After receiving the error: " Fatal error: Call to undefined function printer_open() in ~". I checked the php_error_log and received the following information.
PHP Warning: PHP Startup: printer: Unable to initialize module Module compiled with module API=20090626 PHP compiled with module API=20100525 These options need to match
I've looked for hours trying to find a pre-compiled php_printer.dll for PHP 5.4.7 to no avail. I have concluded that I will have to compile it from source files in the PECL. pecl.php.net/package/printer
Having never had to do this before I did what any internet user should do. I googled it and found some information here: https://wiki.php.net/internals/windows/stepbystepbuild
It took me all day but the PHP build worked. But then tried to create the php_printer.dll First I tried :
svn co http://svn.php.net/repository/pecl/printer/trunk pecl/printer
But it said: 'svn' is not recognized as an internal or external command, operable program or batch file.
So I just downloaded the files myself from: svn.php.net/repository/pecl/printer/trunk/ and put them in: C:\php-sdk\php54dev\vc9\x86\php5.4-201303311430\ext\printer
I made sure to download the libraries both from: windows.php.net/downloads/php-sdk/deps/vc9/x86/ Also just the: deps-5.4-vc9-x86.7z
I tried one then the other, however; every time I received the following when I tried to nmake:
c:\php-sdk\php54dev\vc9\x86\php5.4-201303311430>nmake Microsoft (R) Program Maintenance Utility Version 9.00.30729.01 Copyright (C) Microsoft Corporation. All rights reserved. printer.c ext\printer\printer.c(266) : error C2065: 'pval' : undeclared identifier
UPDATE
I got some help on another forum.
by hackattack142 » 03. April 2013 23:51
Hello,
Open 'printer.c' and replace all instances of 'pval' with 'zval' and it should compile.
Thank you Hackattack, one step closer I hope,
c:\php-sdk\php54dev\vc9\x86\php5.4-201303311430>buildconf ~ c:\php-sdk\php54dev\vc9\x86\php5.4-201303311430>configure --disable-all --enable-cli --enable-printer ~ c:\php-sdk\php54dev\vc9\x86\php5.4-201303311430>nmake Microsoft (R) Program Maintenance Utility Version 9.00.30729.01 Copyright (C) Microsoft Corporation. All rights reserved. internal_functions.c printer.c Creating library Release_TS\php5ts.lib and object Release_TS\php5ts.exp Creating library Release_TS\php.lib and object Release_TS\php.exp SAPI sapi\cli build complete
It seemed to have compiled. However; I can't find a printer.dll or a php_printer.dll which is the outcome I was hoping for.
In the Release_TS\ext folder there is a folder named Printer. It contains the following Files: printer.obj printer.sbr vc90.idb
I also did the last step:
c:\php-sdk\php54dev\vc9\x86\php5.4-201303311430>cd Release_TS c:\php-sdk\php54dev\vc9\x86\php5.4-201303311430\Release_TS>php -m [PHP Modules] Core date ereg pcre printer Reflection SPL standard [Zend Modules] c:\php-sdk\php54dev\vc9\x86\php5.4-201303311430\Release_TS>
Help from another forum
configure --disable-all --enable-cli --enable-printer=shared
It worked and i created the php_printer.dll however when i tried to use it:
In PHP Error Log: [15-Apr-2013 15:34:53 UTC] PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'php_printer.dll' in Unknown on line 0
I had to grab 5.4.7 files as I was using 5.4.15 but XAMPP 1.8.1 uses 5.4.7
http://www.oldapps.com/php_programming_language.php?old_php=8227
And put it in: C:\php-sdk\php54dev\vc9\x86\php-5.4.7
then put the printer files in the ext folder and did all the above processes and:
configure --enable-printer=shared
And it worked:
PHP Version 5.4.7 php_printer.dll
http://pylonx.com/PHP/php_printer_5.4.7.zip
解决方案Download and install any version of php you like and install the appropriate php printer dll here: http://windows.php.net/downloads/pecl/snaps/printer/0.1.0-dev/
这篇关于PHP 5.4.7编译ext php_printer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!