Install Curl Windows Server 2003
0.1 This guide does not cover the initial setup of IIS, or general configuration of Windows Server 2003. Download Curl. Version 0.8 of Curl. They will display the Curl welcome page from our server if you are connected. Even under Windows. Then Curl will start up.
Use the following steps to install curl:. Open in a browser. Select your operating system in the dropdown box: either Windows /Win32 or Win 64. Click Select!. For Win 32, choose whether you will use curl in a Windows Command Prompt (Generic) or in a Cygwin terminal (cygwin). For Win 64, choose whether you will use curl in a Windows Command Prompt (Generic) or MinGW (MinGW64). Click Select!.
If required, choose your Windows operating system. Click Download for the version which has SSL enabled or disabled. Open the downloaded zip file. Extract the files to an easy-to-find place, such as C: Program Files. Testing curl. Open up the Windows Command Prompt terminal. (From the Start menu, click Run, then type cmd.).
Set the path to include the directory where you put curl.exe. For example, if you put it in C: Program Files curl, then you would type the following command: set path=%path%;'c: Program Files curl' NOTE: You can also directly copy the curl.exe file any existing path in your path. Type curl. You should see the following message: curl: try 'curl –help' or 'curl –message' for more information This means that curl is installed and the path is correct. I had also problems with this. After all these steps made correctly and some fixed misunderstandings (there is no extensionsdir but extensiondir, and there is no sessions.savepath but session.savepath) nothing works. Finally I found this note at php.net: Note: Note to Win32 Users: In order to enable this module on a Windows environment, libeay32.dll and ssleay32.dll must be present in your PATH.
You don't need libcurl.dll from the cURL site. So I copied ssleay32.dll, libeay32.dll & phpcurl.dll From /PHP to Windows/system32 and replaced already existing files (I noticed there were older versions of ssleay32.dll and libeay32.dll). After that I found CURL section in phpinfo; and finally everything works.
I recently installed Curl on PHP5 for Windows Vista. I did not enable the CURL library when I initially installed PHP5, so nothing about Curl was showing up in phpinfo or php.ini. I installed CURL by re-running the PHP5 installer (php-5.2.8-win32-installer.msi for me) and choosing 'Change'. Then, I added the CURL component. Restart Apache, and CURL should work. CURL will show up in phpinfo.
Also, here is a sample script you can run to verify it works. It displays an RSS feed from Google.
Installation on old Windows systems This section applies to Windows 98/Me and Windows NT/2000/XP/2003. PHP will not work on 16 bit platforms such as Windows 3.1 and sometimes we refer to the supported Windows platforms as Win32. Note: Windows XP/2003 are no longer supported as of PHP 5.5.0.
Note: Windows 98/Me/NT4/2000 are no longer supported as of PHP 5.3.0. Note: Windows 95 is no longer supported as of PHP 4.3.0.
If you have a development environment such as Microsoft Visual Studio, you can also PHP from the original source code. Once you have PHP installed on your Windows system, you may also want to for added functionality. Changing the php.ini file After the php package content has been extracted, copy the php.ini-production into php.ini in the same folder. If necessary, it is also possible to place the php.ini into any other location of your choice but that will require additional configuration steps as described in. The php.ini file tells PHP how to configure itself, and how to work with the environment that it runs in.
Here are a number of settings for the php.ini file that help PHP work better with Windows. Some of these are optional. There are many other directives that may be relevant to your environment - refer to the for more information. Required directives:. extensiondir = - The extensiondir needs to point to the directory where PHP extensions files are stored.
The path can be absolute (i.e. 'C: PHP ext') or relative (i.e. Extensions that are listed lower in the php.ini file need to be located in the extensiondir. extension = xxxxx.dll - For each extension you wish to enable, you need a corresponding 'extension=' directive that tells PHP which extensions in the extensiondir to load at startup time. logerrors = On - PHP has an error logging facility that can be used to send errors to a file, or to a service (i.e. Syslog) and works in conjunction with the errorlog directive below. When running under IIS, the logerrors should be enabled, with a valid errorlog.
errorlog = - The errorlog needs to specify the absolute, or relative path to the file where PHP errors should be logged. This file needs to be writable for the web server. The most common places for this file are in various TEMP directories, for example 'C: inetpub temp php-errors.log'. cgi.forceredirect = 0 - This directive is required for running under IIS.
It is a directory security facility required by many other web servers. However, enabling it under IIS will cause the PHP engine to fail on Windows. cgi.fixpathinfo = 1 - This lets PHP access real path info following the CGI Spec. The IIS FastCGI implementation needs this set. fastcgi.impersonate = 1 - FastCGI under IIS supports the ability to impersonate security tokens of the calling client.
This allows IIS to define the security context that the request runs under. fastcgi.logging = 0 - FastCGI logging should be disabled on IIS. If it is left enabled, then any messages of any class are treated by FastCGI as error conditions which will cause IIS to generate an HTTP 500 exception. Optional directives.
maxexecutiontime = ## - This directive tells PHP the maximum amount of time that it can spend executing any given script. The default for this is 30 seconds. Increase the value of this directive if PHP application take long time to execute. memorylimit = ###M - The amount of memory available for the PHP process, in Megabytes. The default is 128, which is fine for most PHP applications. Some of the more complex ones might need more. displayerrors = Off - This directive tells PHP whether to include any error messages in the stream that it returns to the Web server.
If this is set to 'On', then PHP will send whichever classes of errors that you define with the errorreporting directive back to web server as part of the error stream. For security reasons it is recommended to set it to 'Off' on production servers in order not to reveal any security sensitive information that is often included in the error messages. openbasedir =, e.g. Openbasedir='C: inetpub wwwroot;C: inetpub temp'. This directive specified the directory paths where PHP is allowed to perform file system operations. Any file operation outside of the specified paths will result in an error.
This directive is especially useful for locking down the PHP installation in shared hosting environments to prevent PHP scripts from accessing any files outside of the web site's root directory. uploadmaxfilesize = ###M and postmaxsize = ###M - The maximum allowed size of an uploaded file and post data respectively. The values of these directives should be increased if PHP applications need to perform large uploads, such as for example photos or video files.
PHP is now setup on your system. The next step is to choose a web server, and enable it to run PHP.
Choose a web server from the table of contents. In addition to running PHP via a web server, PHP can run from the command line just like a.BAT script. Cscript%windir% system32 inetsrv fcgiconfig.js -add -section:'PHP' ^ -extension:php -path:'C: PHP php-cgi.exe' This command will create an IIS script mapping for.php file extension, which will result in all URLs that end with.php being handled by FastCGI extension. Also, it will configure FastCGI extension to use the executable php-cgi.exe to process the PHP requests.
Note: At this point the required installation and configuration steps are completed. The remaining instructions below are optional but highly recommended for achieving optimal functionality and performance of PHP on IIS. Impersonation and file system access It is recommended to enable FastCGI impersonation in PHP when using IIS. This is controlled by the fastcgi.impersonate directive in php.ini file. When impersonation is enabled, PHP will perform all the file system operations on behalf of the user account that has been determined by IIS authentication.
This ensures that even if the same PHP process is shared across different IIS web sites, the PHP scripts in those web sites will not be able to access each others' files as long as different user accounts are used for IIS authentication on each web site. For example IIS 5.1 and IIS 6.0, in its default configuration, has anonymous authentication enabled with built-in user account IUSR used as a default identity. This means that in order for IIS to execute PHP scripts, it is necessary to grant IUSR account read permission on those scripts. If PHP applications need to perform write operations on certain files or write files into some folders then IUSR account should have write permission to those.
To determine which user account is used by IIS anonymous authentication, follow these steps. FastCGI and PHP Recycling configuration Configure IIS FastCGI extension settings for recycling of PHP processes by using the commands shown below. The FastCGI setting instanceMaxRequests controls how many requests will be processed by a single php-cgi.exe process before FastCGI extension shuts it down. The PHP environment variable PHPFCGIMAXREQUESTS controls how many requests a single php-cgi.exe process will handle before it recycles itself. Make sure that the value specified for FastCGI InstanceMaxRequests setting is less than or equal to the value specified for PHPFCGIMAXREQUESTS. %windir% system32 inetsrv appcmd set config /section:system.webServer/handlers ^ /+name='PHPviaFastCGI', path='.php',verb='.' ,modules='FastCgiModule',^ scriptProcessor='c: PHP php-cgi.exe',resourceType='Either' This command creates an IIS handler mapping for.php file extension, which will result in all URLs that end with.php being handled by FastCGI module.
Note: At this point the required installation and configuration steps are completed. The remaining instructions below are optional but highly recommended for achieving optimal functionality and performance of PHP on IIS.
Impersonation and file system access It is recommended to enable FastCGI impersonation in PHP when using IIS. This is controlled by the fastcgi.impersonate directive in php.ini file.
When impersonation is enabled, PHP will perform all the file system operations on behalf of the user account that has been determined by IIS authentication. This ensures that even if the same PHP process is shared across different IIS web sites, the PHP scripts in those web sites will not be able to access each other's files as long as different user accounts are used for IIS authentication on each web site. For example IIS 7, in its default configuration, has anonymous authentication enabled with built-in user account IUSR used as a default identity.
This means that in order for IIS to execute PHP scripts, it is necessary to grant IUSR account read permission on those scripts. If PHP applications need to perform write operations on certain files or write files into some folders then IUSR account should have write permission to those. To determine what user account is used as an anonymous identity in IIS 7 use the following command.
Replace the 'Default Web Site' with the name of IIS web site that you use. In the output XML configuration element look for the userName attribute.
%windir% system32 inetsrv appcmd.exe list config 'Default Web Site' ^ /section:anonymousAuthentication Note: If userName attribute is not present in the anonymousAuthentication element, or is set to an empty string, then it means that the application pool identity is used as an anonymous identity for that web site. To modify the permissions settings on files and folders, use the Windows Explorer user interface or icacls command. FastCGI and PHP Recycling configuration Configure IIS FastCGI settings for recycling of PHP processes by using the commands shown below. The FastCGI setting instanceMaxRequests controls how many requests will be processed by a single php-cgi.exe process before IIS shuts it down. The PHP environment variable PHPFCGIMAXREQUESTS controls how many requests a single php-cgi.exe process will handle before it recycles itself. Make sure that the value specified for FastCGI InstanceMaxRequests setting is less than or equal to the value specified for PHPFCGIMAXREQUESTS.
Apache 1.3.x on Microsoft Windows This section contains notes and hints specific to Apache 1.3.x installs of PHP on Microsoft Windows systems. There are also Note: Please read the first! There are two ways to set up PHP to work with Apache 1.3.x on Windows.
One is to use the CGI binary ( php.exe for PHP 4 and php-cgi.exe for PHP 5), the other is to use the Apache Module DLL. In either case you need to edit your httpd.conf to configure Apache to work with PHP, and then restart the server. It is worth noting here that now the SAPI module has been made more stable under Windows, we recommend it's use above the CGI binary, since it is more transparent and secure. Although there can be a few variations of configuring PHP under Apache, these are simple enough to be used by the newcomer. Please consult the Apache Documentation for further configuration directives. After changing the configuration file, remember to restart the server, for example, NET STOP APACHE followed by NET START APACHE, if you run Apache as a Windows Service, or use your regular shortcuts. Note: Remember that when adding path values in the Apache configuration files on Windows, all backslashes such as c: directory file.ext should be converted to forward slashes: c:/directory/file.ext.
A trailing slash may also be necessary for directories. Apache 2.x on Microsoft Windows This section contains notes and hints specific to Apache 2.x installs of PHP on Microsoft Windows systems. We also Note: You should read the first! Note: Apache 2.2 Support Users of Apache 2.2 should note that the DLL file for Apache 2.2 is named php5apache22.dll rather than php5apache2.dll and is available only for PHP 5.2.0 and later. You are strongly encouraged to consult the to get a basic understanding of the Apache 2.x Server. Also consider reading the for Apache 2.x before reading on here. Apache 2.x is designed to run on the Windows version designated as server platforms, such as Windows NT 4.0, Windows 2000, Windows XP, or Windows 7.
While Apache 2.x works tolerably well on Windows 9x, support on these platforms is incomplete, and some things will not work correctly. There is no plan to remedy this situation. Download the most recent version of and a fitting PHP version.

Follow the and come back to go on with the integration of PHP and Apache. There are three ways to set up PHP to work with Apache 2.x on Windows. You can run PHP as a handler, as a CGI, or under FastCGI. Note: Remember that when adding path values in the Apache configuration files on Windows, all backslashes such as c: directory file.ext should be converted to forward slashes: c:/directory/file.ext. A trailing slash may also be necessary for directories. # LoadModule php5module 'c:/php/php5apache2.dll' AddHandler application/x-httpd-php.php # configure the path to php.ini PHPIniDir 'C:/php' Note: Remember to substitute your actual path to PHP for the C:/php/ in the above examples.
Take care to use either php5apache2.dll or php5apache22.dll in your LoadModule directive and verify that the referenced file is in fact located at the file path that you point to in this directive. The above configuration will enable PHP handling of any file that has a.php extension, even if there are other file extensions. For example, a file named example.php.txt will be executed by the PHP handler. To ensure that only files that end in.php are executed, use the following configuration instead. Assoc.php=PHPScript ftype PHPScript=c: php php.exe%1%.
In the Netscape Enterprise Administration Server create a dummy shellcgi directory and remove it just after (this step creates 5 important lines in obj.conf and allow the web server to handle shellcgi scripts). In the Netscape Enterprise Administration Server create a new mime type (Category: type, Content-Type: magnus-internal/shellcgi, File Suffix:php). Do it for each web server instance you want PHP to run More details about setting up PHP as a CGI executable can be found here. Init fn='load-modules' funcs='php4init,php4execute,php4authtrans' shlib='c:/php/sapi/php4nsapi.dll' Init fn='php4init' LateInit='yes' errorString='Failed to initialise PHP!'
phpini='c:/path/to/php.ini' (PHP = 4.3.3) The phpini parameter is optional but with it you can place your php.ini in your web server configuration directory. Configure the default object in obj.conf (for virtual server classes Sun Web Server 6.0+ in their vserver.obj.conf): In the section, place this line necessarily after all 'ObjectType' and before all 'AddLog' lines. Service fn='php4execute' type='magnus-internal/x-httpd-php' inikey=value inikey=value. (PHP = 4.3.3) As additional parameters you can add some special php.ini-values, for example you can set a docroot='/path/to/docroot' specific to the context php4execute is called. For boolean ini-keys please use 0/1 as value, not 'On','Off'.
(this will not work correctly), e.g. Zlib.outputcompression=1 instead of zlib.outputcompression='On'. This is only needed if you want to configure a directory that only consists of PHP scripts (same like a cgi-bin directory).
ObjectType fn='force-type' type='magnus-internal/x-httpd-php' Service fn=php4execute inikey=value inikey=value. After that you can configure a directory in the Administration server and assign it the style x-httpd-php. All files in it will get executed as PHP.
This is nice to hide PHP usage by renaming files to.html. Restart your web service and apply changes. Do it for each web server instance you want PHP to run Note: More details about setting up PHP as an NSAPI filter can be found here: Note: The stacksize that PHP uses depends on the configuration of the web server. If you get crashes with very large PHP scripts, it is recommended to raise it with the Admin Server (in the section 'MAGNUS EDITOR'). CGI environment and recommended modifications in php.ini Important when writing PHP scripts is the fact that Sun JSWS/Sun ONE WS/iPlanet/Netscape is a multithreaded web server. Because of that all requests are running in the same process space (the space of the web server itself) and this space has only one environment.
If you want to get CGI variables like PATHINFO, HTTPHOST etc. It is not the correct way to try this in the old PHP way with or a similar way (register globals to environment, $ENV). You would only get the environment of the running web server without any valid CGI variables! Note: Why are there (invalid) CGI variables in the environment? Answer: This is because you started the web server process from the admin server which runs the startup script of the web server, you wanted to start, as a CGI script (a CGI script inside of the admin server!). This is why the environment of the started web server has some CGI environment variables in it.
You can test this by starting the web server not from the administration server. Use the command line as root user and start it manually - you will see there are no CGI-like environment variables. Simply change your scripts to get CGI variables in the correct way for PHP 4.x by using the superglobal. If you have older scripts which use $HTTPHOST, etc., you should turn on registerglobals in php.ini and change the variable order too (important: remove 'E' from it, because you do not need the environment here). Error fn='php4execute' code=XXX script='/path/to/script.php' inikey=value inikey=value.
where XXX is the HTTP error code. Please delete any other Error directives which could interfere with yours.
If you want to place a page for all errors that could exist, leave the code parameter out. Your script can get the HTTP status code with. Another possibility is to generate self-made directory listings.
Just create a PHP script which displays a directory listing and replace the corresponding default Service line for type='magnus-internal/directory' in obj.conf with the following. Note about and subrequests (PHP = 4.3.3) The NSAPI module now supports the function (alias: ) to make subrequests on the web server and insert the result in the web page. The problem is, that this function uses some undocumented features from the NSAPI library. Under Unix this is not a problem, because the module automatically looks for the needed functions and uses them if available. If not, is disabled. Under Windows limitations in the DLL handling need the use of a automatic detection of the most recent ns-httpdXX.dll file. This is tested for servers till version 6.1.
If a newer version of the Sun server is used, the detection fails and is disabled. If this is the case, try the following: Add the following parameter to php4init in magnus.conf/ obj.conf. #for PHP 4.php = c: php php4isapi.dll #for PHP 5.php = c: php php5isapi.dll (This line assumes that PHP was installed in c: php.). Now restart the Sambar server for the changes to take effect. Note: If you intend to use PHP to communicate with resources which are held on a different computer on your network, then you will need to alter the account used by the Sambar Server Service. The default account used for the Sambar Server Service is LocalSystem which will not have access to remote resources. The account can be amended by using the Services option from within the Windows Control Panel Administation Tools.
Warning A server deployed in CGI mode is open to several possible vulnerabilities. Please read our to learn how to defend yourself from such attacks. Make sure the web server is running, and point your browser to xitamis admin console (usually and click on Configuration.
Navigate to the Filters, and put the extension which PHP should parse (i.e.php) into the field File extensions (.xxx). In Filter command or script put the path and name of your PHP CGI executable i.e. C: php php.exe for PHP 4, or C: php php-cgi.exe for PHP 5. Press the 'Save' icon. Restart the server to reflect changes.
Installation of extensions on Windows After installing PHP and a web server on Windows, you will probably want to install some extensions for added functionality. You can choose which extensions you would like to load when PHP starts by modifying your php.ini.
You can also load a module dynamically in your script using. The DLLs for PHP extensions are prefixed with php. Many extensions are built into the Windows version of PHP.
This means additional DLL files, and the directive, are not used to load these extensions. The Windows table lists extensions that require, or used to require, additional PHP DLL files. Here's a list of built in extensions (updated PHP 5.0.4):, and.
The default location PHP searches for extensions is C: php5. To change this setting to reflect your setup of PHP edit your php.ini file:. You will need to change the setting to point to the directory where your extensions lives, or where you have placed your php.dll files. // change the following line from.;extension=phpbz2.dll //.

Install Curl Windows Server 2012
To extension=phpbz2.dll. Some of the extensions need extra DLLs to work.
Couple of them can be found in the distribution package, in the main folder, but some, for example Oracle ( phpoci8.dll) require DLLs which are not bundled with the distribution package. Don't forget to include C: php in the system PATH (this process is explained in a separate ). Some of these DLLs are not bundled with the PHP distribution.
See each extensions documentation page for details. Also, read the manual section titled for details on PECL. An increasingly large number of PHP extensions are found in PECL, and these extensions require a.
Note: If you are running a server module version of PHP remember to restart your web server to reflect your changes to php.ini. The following table describes some of the extensions available and required additional dlls. PHP Extensions Extension Description Notes phpbz2.dll compression functions None phpcalendar.dll conversion functions None phpcrack.dll functions None phpctype.dll family functions None phpcurl.dll, Client URL library functions Requires: libeay32.dll, ssleay32.dll (bundled) phpdba.dll: DataBase (dbm-style) Abstraction layer functions None phpdbase.dll functions None phpdbx.dll functions phpexif.dll functions. And, phpexif.dll must be loaded after phpmbstring.dll in php.ini. Phpfbsql.dll functions None phpfdf.dll: Forms Data Format functions.
Requires: fdftk.dll (bundled) phpfilepro.dll functions Read-only access phpftp.dll functions None phpgd2.dll library image functions GD2 phpgettext.dll functions PHP = 4.2.3 requires libintl-1.dll, iconv.dll (bundled). C: PHP5 php.exe -f 'C: PHP Scripts script.php' - -arg1 -arg2 -arg3 But there are some easy steps that can be followed to make this simpler. Some of these steps should already have been taken, but are repeated here to be able to provide a complete step-by-step sequence. Note: Both PATH and PATHEXT are important pre-existing system variables in Windows, and care should be taken to not overwrite either variable, only to add to them. Append the location of the PHP executable ( php.exe, php-win.exe or php-cli.exe depending upon your PHP version and display preferences) to the PATH environment variable. Read more about how to add your PHP directory to PATH in the. Append the.PHP extension to the PATHEXT environment variable.
This can be done at the same time as amending the PATH environment variable. Follow the same steps as described in the but amend the PATHEXT environment variable rather than the PATH environment variable. Note: The position in which you place the.PHP will determine which script or program is executed when there are matching filenames. For example, placing.PHP before.BAT will cause your script to run, rather than the batch file, if there is a batch file with the same name. Associate the.PHP extension with a file type. This is done by running the following command.