I'm unable to make ioncube encoder work with Apache 2.4.12 and PHP 5.5.8. So, this is what I've done by now:
1. Installed httpd-2.4.12-win32-VC11 [http://www.apachelounge.com/download/]
2. Installed php-5.5.8-Win32-VC11-x64.zip [http://windows.php.net/downloads/releases/archives/]
Their raw combination works ok - I can run php scripts etc. I then:
3. Installed ioncube for Windows VC11 (64 bits) [https://www.ioncube.com/loaders.php]
I made corrections to php.ini and when I do php -m I see that it loads ioncube extension without any errors. However, when I now start Apache I get an error with a message about zend_get_hash_value and php5ts.dll. (PS. Combination with Apache 2.2, PHP 5.4 and ioncube works for me, but it seems rather outdated).
It seems like you have mismatched the thread-safe version of Apache and the ionCube Loader. PHP extensions have to match exactly the version that they run on, that is PHP with thread-safety enabled has to have a thread-safe Loader.
To confirm this, go to the output of your phpinfo(); and look for the entry Thread Safety. If it says disabled, make sure you have the Non-TS version of the ionCube Loader (Win x64 Non-TS zip). Likewise, if it says enabled, make sure you have to thread-safe version of the Loader (Win x64 TS zip).
Furthermore, please consider using 32bit PHP / Apache on Windows, as PHP 64bit is still marked as experimental and can cause issues with the ionCube Loader:
The x64 builds of PHP for Windows should be considered experimental, and do not yet provide 64-bit integer or large file support (source)
Related
[EVERYTHING WORKS NOW!]
MY SOLUTION:
The first mistake i made, was simply, that i had some random 32bit version of PHP installed, and some random 64bit version of Apache! After that, i just downloaded the latest version of PHP, and put it in my c:\php folder, THEN downloaded the LATEST version of the VC14 version of Apache, from the apachelounge website (VC14 category on the left side on the website). And the last mistake was, that i had the W3SVC from IIS still running, so i stopped that one under services (search in windows for services.msc)! And yeah, thats it, all solved now!
So, i have a problem, i installed Apache recently, and set up a working webserver!
This all worked fine, my whole website works flawlessly, and its fully usable!
BUT, all of my php scripts did NOT work, when loading one on the website, apache just show the entire source code of the .php file, instead of displaying it like an html page!
So, i noticed, i do not have PHP configured with my apache server!
What i then did, was download php, put it in c:\php, configure the php.ini, and all of that works, i know because in IIS 10, my website worked perfectly fine with PHP!
so i installed php, for apache 2.4, the VS11 version, the same goes for apache, (i did that because the latest versions of both did not work for me, i had the same problem)!
and as soon as i do the last step,
add these lines to my httpd.conf (inside my apache folder):
LoadModule php5_module "c:/php/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
PHPIniDir " C:/php"
, when i want to start the apache server, it just tells me this:
"The requested operation has failed."
(this happens when i select the service of my server in the Apache-Monitor, and click on "start)
(NO error log is beeing created from apache, nothing inside the error nor log folder (both configure in the httpd.conf))
only CMD gives me the following erro:
httpd: Syntax error on line 533 of C:/Apache24/conf/httpd.conf: Cannot
load c:/php/php5apache2_4.dll into server: %1 is not a valid Win32
application.
Now, as soon as i remove these 3 lines from my httpd.conf, the server works perfectly fine again, can be started, and the website is usable, except, all php pages do not work(of course).
i heard something about a "libphp5.so", i do not know if it has anything to do with neither my apache server, nor my whole problem, but i don't know, atleast i have no such thing in my "C:\Apache24" folder!
SOME INFORMATION THAT MIGHT BE IMPORTANT:
All this is hosted from a normal PC (Windows 10) (64 Bit), 32GB RAM, 8x4GHz processor etc..!
yes, i have added c:\php to my Path environment variable! (as said before, all is working if i do not add these lines, which according to google results, are necessary to get php to work with apache)!
If anyone knows what to do, id be so glad, because i do not want to keep using IIS (its good but..), as i could do definitely more with Apache!
Read the manual carefully. Reinstall apache and use PHP 5.6. unless you are ready to fix issues that come with PHP 7.1. Notice Do NOT use VC11+ versions of PHP with the apache.org binaries. This is taken from PHP.net
Apache:
Please use the Apache builds provided by Apache Lounge. They
provide VC11, VC14 and VC15 builds of Apache for x86 and x64. We use
their binaries to build the Apache SAPIs.
If you are using PHP as module with Apache builds from apache.org (not
recommended) you need to use the older VC6 versions of PHP compiled
with the legacy Visual Studio 6 compiler. Do NOT use VC11+ versions of
PHP with the apache.org binaries.
With Apache you have to use the Thread Safe (TS) versions of PHP.
VC11, VC14 & VC15 More recent versions of PHP are built with VC11,
VC14 or VC15 (Visual Studio 2012, 2015 or 2017 compiler respectively)
and include improvements in performance and stability.
The VC11 builds require to have the Visual C++ Redistributable for Visual Studio 2012 x86 or x64 installed
The VC14 builds require to have the Visual C++ Redistributable for Visual Studio 2015 x86 or x64 installed
The VC15 builds require to have the Visual C++ Redistributable for Visual Studio 2017 x64 or x86 installed
TS and NTS TS refers to multithread capable builds. NTS refers to
single thread only builds. Use case for TS binaries involves
interaction with a multithreaded SAPI and PHP loaded as a module into
a web server. For NTS binaries the widespread use case is interaction
with a web server through the FastCGI protocol, utilizing no
multithreading (but also for example CLI).
Source: PHP.NET Manual
Make sure Apache2 and PHP binaries have the same:
Visual Studio C++ binary compatibility version
(Visual Studio C++ 2015 = VC14, Visual Studio C++ 2017 = VC15)
system architecture: 32bit(win32) / 64bit(win64)
for example:
php-7.3.15RC1-Win32-VC15-x86
be sure u have:
httpd-2.4.41-win32-VC15
best place to download Apache 2 binaries for Windows is Apache Lounge
(on Top Left corner you control the VC version):
https://www.apachelounge.com/download/VC15/
and to download PHP binaries also mind that with Apache you have to use the Thread Safe (TS) versions of PHP. go here:
https://windows.php.net/qa/
do not forget to add (System Variables) PATH for php,
open cmd As Administrator and type:
setx path "%PATH%, C:\php73" /M
Iam try to install (switch) PHP v5.1.6 with last version of Wamp, but a console message says: "This PHP version doesn't seem to be compatible with your actual Apache Version. Switch cancelled..."
How I can know the apache version compatible with the php version indicated (5.1.6)? What is the procedure to downgrade the version current version of apache?
THX
PHP5.1.anything will not run with Apache 2.4.anything.
If you look in the PHP5.1.6 folder you will NOT see a php5apache2_4.dll, which is PHP for that version compiled as a DLL with linkages to Apache 2.4, all you will see is a php5apache2_2.dll i.e. that version of PHP compiled with Apache 2.2 linkages. Its possible that version of PHP only has linkages for Apache 2.0, in which case it could be a real pain trying to get it working.
So you will also have to install a Apache2.2 or maybe Apache 2.0 that will run with it.
Both Apache and PHP will need to be compiled with the same compiler, probably VC6, as I think PHP5.1 was almost definitely compiled with VC6.
You may also find it useful to install another version of PHP like PHP5.3.29 maybe as this will run under Apache 2.2 and Apache 2.4, then when you are switching versions you can step backwards like so :-
While running Apache2.4 and PHP 5.4.16
Switch to PHP 5.3.29
Then switch to Apache 2.2.?
Then switch from PHP 5.3.29 to 5.1.6
This assumes PHP5.1.6 runs with Apache 2.2 and does not need the extra steps to ge back to Apache 2.0
You may also need other PHP's or Apache's I am not absolutely sure as its a long ways back from PHP5.4 to PHP5.1, but I hope this gives you a bit of an idea what might be involved.
Alternatively you could backup your current WAMPServer and uninstall it, and install an old version of WAMPServer 2.2a/b/c/d/e... You will have to try a few to see if they go back that far
I'm trying to integrate php on Apache. Following is the versions I'm using
Apache 2.4 (httpd-2.0.64-win32-x86-openssl-0.9.8o)
PHP (php-5.5.0-Win32-VC11-x64.zip)
I'm setting this on a 64 bit windows 7 machine. I have made the configurations as per this, but I'm getting the following error even though I have place the dll in the specified folder.
Cannot load C:/php/php5apache2_4.dll into server: The specified
module could not be found.
The httpd.conf line entry is this
LoadModule php5_module "C:/php/php5apache2_4.dll"
Is there any version compatible issues?
The only way I've been able to get PHP (5.5) to work with Apache (2.4) on Windows (7 and 8) is to make sure Apache and PHP are both either 32-bit (x86) or 64-bit (x64) and that Apache and PHP are both Thread Safe (TS). Using Non-Thread Safe (NTS) did not work for me (or others), and the Thread Safe build comes bundled with the needed Apache Module for PHP "php5apache2_4.dll". Once all my bit-depths and thread safety was matched up, Apache 2.4 and PHP 5.5 work well together on my Windows systems.
Both products must also have been compiled using the same major versions of Microsoft Visual Studio/C++, such as VC6 (the legacy VC++ compiler), VC9=Studio 2008, or VC11=Studio 2012. For the above Apache versions, only VC9 or VC11 are commonly used.
Links:
Get Windows Apache binaries here:
http://www.apachelounge.com/download/
Get Windows PHP binaries here:
http://windows.php.net/download/
Install the Visual C++ Redistributable compiler runtime library for the specific Visual Studio version used to prepare both Apache and PHP for Windows:
2012: http://www.microsoft.com/en-us/download/details.aspx?id=30679
2008: http://www.microsoft.com/en-us/download/details.aspx?id=5582
You are right Marty, they work only if both are either 32bit or 64 bit. I used XAMPP- Apache's distributed installation to resolve this issue.
Apache win 32 with 64 bits its the problem, you need Apache64
I need to install PHP 5.3.x (preferably x >= 4) on Windows box running Apache. Unfortunately, in the PHP downloads page, I cannot find any PHP 5.3.x compiled with VC6. So...
Can I use the VC9 binaries on Apache?
If so, how? Do I have to do anything special?
From the release announcement:
Windows users: please mind that we do no longer provide builds created
with Visual Studio C++ 6. It is impossible to maintain a high quality
and safe build of PHP for Windows using this unmaintained compiler.
For Apache SAPIs (php5_apache2_2.dll), be sure that you use a Visual
Studio C++ 9 version of Apache. We recommend the PHP builds as provided
by ApacheLounge. For any other SAPI (CLI, FastCGI via mod_fcgi, FastCGI
with IIS or other FastCGI capable server), everything works as before.
Third party extension providers must rebuild their extensions to make
them compatible and loadable with the Visual Studio C++9 builds that we
no longer provide.
http://www.apachelounge.com/download/
http://www.apachelounge.com/viewtopic.php?t=2743 - In this thread, they say that using VC9 PHP is not recommended at all with VC6 Apache, even though it might work at first. They don't say why.
http://windows.php.net/qa/ - Here, they also state not to use PHP5.3 VC9 with Apache compiled with VC6 (and also don't state why).
I think it might be best to upgrade your Apache to the VC9 version: http://www.apachelounge.com/download/
PHP 5.3.5 for VC6 server is still available: http://windows.php.net/downloads/releases/archives/
I'm fairly sure you can install the VC9 versions of Apache from http://www.apachelounge.com/download/ and they will work with the 5.3.x VC9 builds.
How can I install APC on Windows? I am using PHP 5.3, Windows 7 x64.
I used
pecl install apc
I got
C:\PHP>pecl install apc
downloading APC-3.0.19.tgz ...
Starting to download APC-3.0.19.tgz (115,735 bytes) ............
done: 115,735 bytes 47 source files, building
WARNING: php_bin c:\php\php.exe appears to have a suffix \php.exe, but config
variable php_suffix does not match running: msdev APC.dsp /MAKE "APC - Release"
ERROR: Did not understand the completion status returned from msdev.exe.
Installing an extension with the pecl command means :
downloading the sources
compiling them
And, generally speaking, a windows machine doesn't have what's required to compile software like PHP and/or PHP extensions.
A better / easier solution, in your case, would probably be to find a pre-compiled .dll of the extension, that matches your system and your version of PHP.
With a bit of luck, maybe one of the versions provided on http://downloads.php.net/pierre/ could be OK ?
(It's what kind of acts as replacement of the old pecl4win, until the extensions for windows are available on windows.php.net)
For more informations about which version you should use, take a look at the Which version do I choose? section, in the left side-bar of http://windows.php.net/
It is not really important, whether you are running Windows 32-bit or 64-bit version. What matters is what Apache (webserver) version you have installed (32/64). Since lots of PHP extensions (like APC) are not available for 64-bit systems, most common setup is as follows:
Operating system 32 or 64-bit (not really important). Apache 32-bit will run easily on Windows 64-bit. The difference is, that for 32-bit apache you MUST install PHP 32-bit. Once you install 64-bit PHP, you may find difficult to install some extensions - there are almost no extensions available for 64-bit PHP platform.
therefore your webserver should be 32-bit if you care about special extensions, like APC, Imagick etc... Also you need to know if your apache is thread safe (TS) or not thread safe (NTS) and whether it has been compiled in Visual Studio 6 (VC6) or newser Visual Studio 2008 (VC9). You will easily find all this info from phpinfo() function.
as for the APC, some nice compilation for Windows are available from http://dev.freshsite.pl/php-accelerators/apc.html.
For php 5.3 you use php.net/pierre/php_apc-3.1.10-5.3-vc9-x86.zip.
Download it and copy php_apc.dll to your php ext directory. (I choose the file under ts I have thread safe php installation. There is also an apc dll file for non thread safe.)
Add extension=php_apc.dll into your php.ini file
Restart your web server
Run phpinfo() to see if it's installed or not.
I am using php 5.4 and I downloaded php.net/pierre/php_apc-3.1.10-5.4-vc9-x86.zip and its working fine.
Hope this will help mate.Good luck.
Also, make sure that the compiled version from here http://downloads.php.net/pierre/
matches your php version, otherwise the extension will not load (php v. 5.2.17 requires php_apc.dll v 5.2.17.17 - which doesn't seem to be available as of this writing - I had to downgrade the php version to play with apc).
Another point, pierre's zip packages, at least the one I downloaded, did not include the management script. you can get it from here: http://pecl.php.net/package/APC - select the version you downloaded, then navigate to Browse Source, then find your version in the 'tags' folder. the apc.php script should be there.
There's no available version for php > 5.4.
I'm using APCu instead. Just download the dll and reference it in php.ini.
This website offers updated dll and installers for Apache, PHP and APC compiled to work on windows 64 bit. I've been using it for a while and it works fine. You could an APC version compatible with PHP 5.3.22 here