I am attempting to compile PHP from source on Windows 7 using windows sdk 6.1. I am receiving the following error when running nmake:
fatal error C1900: Il mismatch between 'P1' version '20080116' and 'P2' version '20070207'
LINK : fatal error LNK1257: code generation failed
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\
VC\Bin\cl.exe"' : return code '0x2'
Stop.
I have already run repair on Visual Studio 2010 to no avail. How can I fix this?
EDIT: I am compiling the C source not actual PHP code.
Do yo really need to build from source PHP?
I mean, there's no need to build php from source, you can use a package such as XAMPP or WAMP. For practical reason I use XAMPP for PHP projects, because XAMPP runs on both Windows and Linux, so the only thing I need to do is a simple folder installation, then a simple LigHTTPD/Apache configuration and that's it.
But if you really want to compile PHP on Windows, you need to install the distributable version of Visual C++ 2008, I don't know why the 2010 version is not working and not only for PHP but for many other libraries of python and many other things.
Visual Studio 2010 does not natively support PHP code. Are you using Phalanger?
Related
I have this error in Windows Server 2012 R2 Standard 64-Bit
HTTP Error 500.0 - Internal Server Error
C:\Program Files (x86)\PHP\v7.4\php-cgi.exe - The FastCGI process exited unexpectedly
Detailed Error Information:
Module FastCgiModule
Notification ExecuteRequestHandler
Handler php-7.4.13
Error Code 0xc0000135
Requested URL http://localhost:80/index.php
Physical Path C:\inetpub\wwwroot\index.php
Logon Method Anonymous
Logon User Anonymous
Works only with PHP Version 5.3.28
When I change the version in PHP manager I get this error, I also tested these versions v7.4, v7.3, v7.2. but still the same problem.
Can you help me
The first thing you need to check is whether you have the right Visual C++ runtime package installed in your PC. If not, download and install it right away.
Visual C++ Redistributable for Visual Studio 2015
Note: You need to install the C++ Redistributable for Visual Studio 20xx that matches its version according to your PHP Version.
So for me it turned out IIS was corrupted somehow. Reinstalled IIS and everything worked out fine.
When troubleshooting I realised:
error was intermittent,
changing PHP versions had no effect
random bugs like missing libraries would occur now and again.
Log files are of no use
Very painful to debug!
I just found out about PTI (see http://www.phpsrc.org/) but I can't seem to get it to work in Eclipse Juno.
I also have PDT installed, with my PHP Executables, PHP Interpreter, and Execution Environments all set up under my workspace preferences. Each PHP Tools feature I want to use is configured to use the PHP Executable and PEAR library I have set up.
When I try to run any of the tools (PHP CodeSniffer, PHP Copy/Paste Detector, PHP Depend, PHPUnit, or PHPMD), I get an alert that say the following:
'PHP Depend' has encountered a problem.
An internal error occurred during: "PHP Depend".
Details >>
An internal error occurred during: "PHP Depend".
org.eclipse.php.internal.debug.core.launching.PHPLaunchUtilities.getCommandLine(
Lorg/eclipse/debug/core/ILaunchConfiguration;
Ljava/lang/String;
Ljava/lang/String;
Ljava/lang/String;
[Ljava/lang/String;
)[Ljava/lang/String;
Has anyone been able to get this awesome tool to work on Juno? If so, how?
I had the same problem.
Downgrading PDT from version 3.2.1 to 3.0.0 (installed from General Tools of 'Indigo') sorted out the problem for me. It works now fine.
I checked many possible workarounds (begin of path here: internal error occurred during: "PHP CodeSniffer". in zend studio 10.0 ) but just above solution gave results.
I've been attempting to get PHP working with IIS 7.5 and have hit a bit of a roadblock. Whenever I try to load the page I get the following error:
"HTTP Error 500.0 - Internal Server Error
C:\Program Files\PHP\php.exe - The FastCGI process exited unexpectedly"
Module FastCgiModule
Notification ExecuteRequestHandler
Handler PHP_via_FastCGI
Error Code 0x00000000
Requested URL *http://localhost:80/index.php
Physical Path C:\inetpub\wwwroot\index.php
Logon Method Anonymous
Logon User Anonymous
Failed Request Tracing Log Directory C:\inetpub\logs\FailedReqLogFiles
I've modified the PHP.ini file as required for use with IIS, and have also switched it to verbose mode. There isn't any log fiel in C:\inetpub\logs\FailedReqLogs, and none related to this error in the other log files generated.
I've tried the other fixes I've found here and elsewhere but nothing's been successful so far.
In some detail these were:
re-checking PHP.ini
Setting up fastCGI to work with PHP in IIS (configuring it to load the php.exe)
Trying WinCache as the execution method.
I had this problem when I upgraded PHP 5.4.14 to 5.5.3 (32-bit).
To fix it I had to install the Visual C++ Redistributable for Visual Studio 2012 Update 3
I found out that I needed this DLL by running php --version from the console when my web pages no longer loaded after the upgrade. Which then revealed that I needed the MSVCR110.dll, that comes with the 32-bit VS redistributable update from MS. Since I have optional updates turned off in Window Update, I did not get it automatically.
They also come in different flavors (32-bit, 64-bit, and ARM) 32-bit is what worked for me.
Install the 32 bit of Visual C++ Redistributable for Visual Studio 2012 Update 4
NOT the 64 bit
It seems that there are some dll extension in your php which are not work properly and force the CGI closed. Try to comment every extensions in php.ini file and see whether the error will exist or not.
[EDIT 1]
After some struggles I found out that the IIS is non thread safe web server and all the extension which you want to use in php for IIS should used nts lib for compiling. If the extension compile with thread safe library and add to IIS the IIS would not start. In this case your extension in thread safe(used in apache I guess) and should not add as an extension in IIS
Is this page you're trying to hit doing anything intensive?
I've had this problem before, and the error message was misleading.
You might want to try increasing your memory limit for that particular page. First find out the peak memory usage for that page:
echo memory_get_peak_usage(true);
Then set your memory limit appropriately:
ini_set("memory_limit","1024M");
Hope that helps!
I know its an old thread, but someone might save some headbashing.
In php.ini, changing
; Whether or not to enable the dl() function. The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
; http://php.net/enable-dl
enable_dl = Off
to
; Whether or not to enable the dl() function. The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
; http://php.net/enable-dl
;enable_dl = Off
Having enable_dl = Off doesn't work, commenting out the entire line does.
I had this problem when I was configuring PHP 5.4.17(32-bit).
To fix it I had to install the Visual C++ Redistributable for Visual Studio 2012 Update 4 and it worked fine after installing this update.
As mentioned correctly in above answers it's related to "Visual C++ Redistributable" that's not installed or not installed correctly.
Depending on my expertise on this issue.
1- First take care, each PHP version depends on specific Visual C++ Redistributable version (11,12,14,..)
so first is to check back your PHP version with the notes on the left side of php site:
PHP Download page
search for "Which version do I choose?" then see what version of VC++ is required to you.
2- YOU HAVE TO Download VC 32 and 64 BOTH. and check if your PC has it already so Unistall both of them (for the same version only).
and then install 32 first and 64 after. (no need for any restarts unless it asks).
3- Complete the php installation other steps for iis, apache or ....
I hope it helps you.
if you have two application like (your app, phpmyadmin) just disable APC extension
Hope that fix the issue
it's worked with me
if not just install Microsoft visual C ++ 86 and 64
I have the same problem, which I fixed by installing the 32 bit of Visual C++, redistributable for Visual Studio 2012. 64 bit doesn't work for me.
This may be because required libraries are not available. Run the php-cgi.exe from a command prompt and see if it executes successfully. It should output some HTML if it is working. I was getting a general 0xFFFFFFFF error code - which is not very helpful.
If it instead returns an error, resolve this before continuing.
I had installed the Visual C++ runtimes as indicated, but the minor version was older than the one used to compile the executable and it failed on starting.
After applying a later version of the same runtime, the program ran normally.
Many of the other suggestions talk about this, but fail to provide a simple test. See The FastCGI process exited unexpectedly for a similar question.
I have installed Vertrigo Server with [Apache 2.0] & [PHP 5.2.14] on Windows XP X32 but Vertrigo server doesn't includes OCI8.DLL extension for Oracle Database. When I tried to copy this DLL file from another version of PHP I got Apache error:
[v_apache.exe]: The application cannot start because php5.dll is
missing.
Without this DLL file everything is wokrking OK, but I need to connect with oracle Database. Have you any solutions how to add OCI8.DLL extension in that version of PHP and Apache?
Thanks.
Simpliest way is to use Zend Server CE.
It has latest stable apache with latest stable PHP stack, also with oci libraries (and much more).
Download for free (registration required).
After long time searching over the internet finaly I found soltion for it. Strange is that Apache doesn't alert error about real problem, it just says that problem is with 80 port, even when 80 port is free.
Solution is very simle: I just installed Microsoft Visual C++ 2010 Redistributable Package and after averithing was running correctly.
I am working on reviving an old project (that only works with < 5.1) that essentially compiles PHP 5.3 into a PE C++ EXE. I have gotten everthing to work really well on multiple Windows 7 computers with only 2 dlls and 1 exe for most applications! Unfortunately, on XP I get:
the application failed to start because the application configuration is incorrect
I have installed Microsoft Visual C++ 2008 Redistributable Package to no avail. I have also copied msvcm90.dll, msvcr90.dll, msvcp90.dll to the same directory as the exe. This also did not work.
Do I just need to compile the project on XP for it to work on XP?
I am really good at PHP, but C is not my forte, so I assume I am missing something obvious in the compiler.
EDIT:
When I compile with just Multi-threaded (/Mt) I get this:
MSVCRT.lib(MSVCR90.dll) : error LNK2005: _fflush already defined in
LIBCMT.lib(fflush.obj)
MSVCRT.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
MSVCRT.lib(MSVCR90.dll) : error LNK2005: _free already defined in LIBCMT.lib(free.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
out/console_debug.exe : fatal error LNK1169: one or more multiply defined symbols found
Try using Dependency Walker on XP to see if you can find any missing dependencies.
Also check the Event Viewer. And make sure you're building the application in Release mode.
Dependency Walker showing a dependency on DWMAPI.DLL is often an incorrect reporting, which can result from having a dependency on mshtml.dll on an XP box with IE7. Did you check the Event Viewer?
The build errors that you posted suggest that you're linking to libraries that are NOT built with /MT flag. Make sure you rebuild everything in your solution; your 2 DLLs, the .EXE and any static libraries with that same flag, assuming you own the DLLs as well.
Do you have the manifest files in your application directory? I'd recommend to make sure they are there and refer correctly to the DLL locations. Take a look at this reference:
http://msdn.microsoft.com/en-us/library/ms235342(VS.80).aspx
Have you tried Project/Properties/ Configuration Properties / C/C++ / Code Generation / Runtime Library -> Multi-threaded (/MT) ?
Try installing the VC2008 redistributables on the XP machine.