How to install php thread in azure platform - php

I am not able to install php thread in azure. as we can not modify most of the directories and php.ini files.

I have followed the steps in this answer Using Pthread in Azure web app in a PHP site to install pthreads in Azure web app successfully with PHP 5.6 (5.6.29) VC11 x86 Thread Safe and pthreads version 2.0.9.
In which case, some additional modifications might be needed in step 3.
3, I used phpinfo() to find default php.ini file in Azure, Then I
browsed Kudu Console of my web app via
https://<your_web_app_name>.scm.azurewebsites.net/DebugConsole/?shell=powershell.
Locate the directory found above. Download the content to local saved
as php.ini in the PHP directory. Uncommented extension_dir = "ext"
in this file.
Once you have downloaded the php.ini file, change
extension_dir="D:\Program Files (x86)\PHP\v5.6\ext\" to
extension_dir = "ext".
Add the line extension=php_pthreads.dll at the end of php.ini file.
Here the pictures:
I also tried to install pthreads v3 with PHP 7, but failed. Seems pthreads v3 is NOT supported by PHP-CGI, only by CLI version. The following statement is from official site.
pthreads v3 is restricted to operating in CLI only: I have spent many
years trying to explain that threads in a web server just don't make
sense, after 1,111 commits to pthreads I have realised that, my advice
is going unheeded.
So I'm promoting the advice to hard and fast fact: you can't use
pthreads safely and sensibly anywhere but CLI.
Thanks for listening ;)
Hope this will help you. Any further concern, please let me know.

Related

Using Pthread in Azure web app in a PHP site

I have a webapp (PHP site using CodeIgniter) hosted on Azure. I have a situation where I want to use the pthread module. Since pthread is not available in PHP out of the box, when I install it using Xampp server, I suspect that it won't be possible to use threading on Azure.
But I am not sure. Azure documentation also doesn't talk about it. Is there a way I can use it pthread on Azure?
I am able to use it on my local Windows machine, using pthread.dll.
To enable extension in Azure Web APP, we should customize PHP runtime on Azure. Please refer to official site.
For this issue,I have tried to install pthreads successfully. And I toke those steps as following:
1, I obtained a PHP 5.4 (5.4.43) VC9 x86 Thread Safe package from PHP site explored to folder named PHP. And followed the pthreads site, got the lasted version of pthreads.
2,Added pthreadVC2.dll (included with the Windows releases) to the same directory as php.exe and added php_pthreads.dll to PHP extention folder.
3,I uesd phpinfo() to find default php.ini file in Azure, which should be similar with the picture:
,
Then I browsed Kudu Console of my web app via https://<your_web_app_name>.scm.azurewebsites.net/DebugConsole/?shell=powershell.
Locate to the directory found above. Download the content to local saved as php.ini in the PHP directory. Uncommented extension_dir = "ext" in this file.
4, Add a bin directory to your root directory (for example, bin\php), and use FTP tool to upload the PHP runtime on it.
5,Browse to the web app in the Azure Portal and click the configure tab.
Add *.php to the Extension field and add the path to the php-cgi.exe executable at the Handler mappings section.
At last, we check the PHP env,we should see the result as below
and run the test code of pthreads to check the extension
If you have any concern, please feel free to let me know.

How to install SAPRFC with PHP 5.4.4 in Windows 32 system?

I've tried a lot of things given over the internet to setup SAPRFC in Windows but they all are talking about PHP 5.2 version but everyone knows that we are using PHP 5.x nowadays.
I'm running Xampp server where my PHP version is 5.4.4 and I need to communicate with SAP server through PHP script. I've tried the procedure of copying librfc.dll in system32 folder and php_saprfc.dll in php/ext folder and also modification of php.ini but it doesn't help me.
I have to following instructions:
Installation:
Extract zip file saprfc-$VERSION$-$PHP_VERSION$.zip
Copy php-saprfc.dll to your extensions directory (e.g. C:\PHP\extensions)
Edit php.ini file (in windows system directory, e.g. C:\WINNT, C:\WINDOWS) and add line: 'extension=php_saprfc.dll'
Copy librfc32.dll (from SAPGUI install CD) to the Windows system directory or simple install SAPGUI on your machine.
Compilation:
Extract php sources to C:\PHP-x.y.z
Extract php win support files to C:\PHP-x.y.z\win32
Install RFCSDK to C:\PHP-x.y.z\rfcsdk
Copy SAPRFC sources to C:\PHP-x.y.z\ext\saprfc
Copy php4ts.lib or php5ts.lib (from PHP binaries) to C:\PHP-x.y.z\win32
For PHP5 copy saprfc.dsp5 to saprfc.dsp
Open project C:\PHP-x.y.z\ext\saprfc\saprfc.dsp in Microsoft Visual C++ 6.
Under Tools|Option|Directory set path for Include files and for Library files:
(C:\PHP-x.y.z\win32\include; C:\PHP-x.y.z\rfcsdk\include;
C:\PHP-x.y.z\win32\lib; C:\PHP-x.y.z\rfcsdk\lib)
Set active configuration to "saprfc - Windows_TS" (under Build menu)
Build php_saprfc.dll.
Compiled DLL you find in C:\PHP-x.y.z\Release_TS directory
But I'm not getting the compilation part.
The newest version is from 2009 and can be found here. For newer PHP versions you have to compile the extension yourself (at least the docs say so). Seems like the devs didn't make the jump to the newer versions because of the compiler needed. In the compilation docs it still says Microsoft Visual C++ 6.0. AFAIK modern PHP uses 9.0. So you propably need to tinker a bit with it. Or you might ask in the SAP forums if someone did the necessary work already.
You can download precompiled version here:
https://sourceforge.net/projects/saprfcsapnwrfc/files/

Change PHP version in IIS 6

Trying to upgrade from PHP 5.2.5 to 5.2.17 (and then to 5.3.6 once that works) on IIS 6.0, installing the language itself runs just fine and I changed the PHP.ini/ect locations that IIS uses for PHP, everything still works but when I run PHP info on my site it still says it's running PHP 5.2.5. Restarted IIS, restarted the server even, no difference. What do I do to change which version/what location of PHP IIS is using?
When I install PHP 5.3.6 the site no longer works, so I know installing different versions is doing SOMETHING, but I think it might only be changing the PHP.ini my server is using, not the version of PHP.
In addition to installing the windows binary release of PHP I've also tried installing PHP from Microsoft's Web Platform Installer (both 5.3.6 and 5.2.17), after installing neither showed up as the current version in phpinfo either.
If you want to use php 5.3, you must install IIS FastCGI extension and run PHP as cgi script. From php 5.3 isapi is not supported. But everything works fine if you configure it, and as benefit you can use more php version simultaneously. IIS 6 is not a problem. Download PHP non thread safe.
For details see this, for example: http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60/
Download the latest VC11 x86 Non Thread Safe version of PHP from http://windows.php.net/download/
Once the zip is downloaded, right click on the zip file and select properties. Make sure you unblock the file.
Rename your current PHP folder to PHPold.
Find your php.ini file and rename it to phpold.ini
Extract the zip file to c:\temp\php.
Copy the php folder from c:\temp to wherever your old PHP folder was.
Go to your new php folder and copy php.ini-production and paste it to where your old php.ini file was
Rename php.ini-production to php.ini
On the server, make sure you have Notepad++ along with the Compare plugin. If you need the compare plugin, use these steps. http://www.davidtan.org/how-to-compare-two-text-files-using-notepad-plus/
In the location that stores your phpold.ini and php.ini, right click on each of those files and open them with Notepad++. On the php.ini, only make changes to the lines with the >> next to them.
Once the changes have been made, make sure you save php.ini.
Go to Services and restart IIS.
Solution has been to move to Apache in my case. IIS 7 has better tools but IIS has proven to be a poor environment for development in this case.

ffmpeg setting up in wamp (in local) OR server

can anyone explain the procedure of installing ffmpeg in wamp.
I got an answer to my previous question on ffmpeg and wamp that we have to interface the ffmpeg (here) with wamp.
I need to have a step by step process of how to do this, as I am confused with the interfacing little bit
I also want to know what is a way to install this ffmpeg into the server, or the procedure to do before we do the encloding procedures
Try the following steps.
Download ffmpeg_new from here: http://sourceforge.net/projects/ffmpeg-php/files/
Copy php_ffmpeg.dll from the php5 folder to the C:\wamp\bin\php\php5.2.9-2\ext
Copy files from common to the windows/system32 folder
Add extension=php_ffmpeg.dll to php.ini file
Restarted all services (Apache, PHP...)
And enable "extension=php_ffmpeg.dll" directive in your php.ini.
All the best.
Thanks,
Kanji
make all the following steps mentioned above with http://sergey89.ru/files/ffmpeg-php/ffmpeg-php-5.3-win32-all.zip
I use php 5.3.5 (wamp 2.1 x32)

Installing IonCube on IIS7 / Windows Server 2008

we've inherited a PHP project from a client that requires IonCube. Our boxes all run on IIS7 and although we've followed the instructions for configuring it, it isn't loading the decoder library. Have any of you had any success with getting IonCube up and running on Win 2k8 (32bit)? I'm pulling my hair out over this so any help would be beyond appreciated.
Thanks
For anyone attempting to do this in the future, here is what you must do:
Determine if you are running a thread-safe version of PHP. You can check that by accessing your php_info or the file they provide. If you are not running a threadsafe version continue:
Download the non-ts version (non-threadsafe version) from the typical download page (there are two version available)
Put the Dlls inside of your Windows\System folder (i put mine in a subfolder)
Add the line zend_extension = C:\Windows\System32\ioncube\ioncube_loader_win_5.2.dll
note that it is NOT zend_extension_ts and is zend_extension instead
restart IIS
Run their ioncube-loader-helper.php file to verify that it worked properly.
Enjoy.

Categories