Configuring the Web site search
You can configure the Web site search to use PHP and Zend
on either Apache or Internet Information Services (IIS).
Installing and configuring Apache, PHP, and Zend and deploying the Engineering Method Composer Web sites on Windows
To install and configure Apache, PHP, and Zend:
Install Apache
- Download Apache 2.x (for example, Apache 2.4.37) from http://httpd.apache.org/download.cgi, and unzip.
- You can run Apache directly from the unzip folder, or install Apache as a service.
- Stop the Apache Web server.
Install PHP
- Download PHP 7.1.x (for example, PHP 7.1.23) from http://www.php.net/, and unzip (for example to C:\PHP)
- In a console window, type php -v to see if it worked.
Configure Apache and PHP
- Navigate to the folder where Apache is installed (for example C:\Apache24) and append the following lines to the file conf\httpd.conf (replacing folder names with your installation folder names if different than the example):
LoadModule php7_module "C:/PHP/php7apache2_4.dll" AddHandler application/x-httpd-php .php PHPIniDir C:/PHP
Test Apache and PHP integration
- Create a file named phpinfo.php with the following
simple content:
<?php phpinfo(); ?> - Save the PHP file in the htdocs folder under the Apache installed directory.
- Restart the Apache Web server.
- Open your browser and enter the following URL address: http://localhost/phpinfo.php. The resulting page displays the PHP Version information.
Configure Zend
- Download ZendFramework-1.8.2.zip from http://framework.zend.com/.
- Extract the .zip file into a folder on your drive. (For example, D:\ZendFramework-1.8.2)
Configure Zend and PHP
- Open the PHP configuration file (php.ini) in
the PHP installed directory for editing and add the following line:
include_path=".;D:\ZendFramework-1.8.2\library\" (Adjust the path according to your Zend installation directory.) - Uncomment the following lines (by removing the leading semicolon of each line):
extension=php_mbstring.dll extension=php_xsl.dll - Save and close the php.ini file.
- Restart the Apache Web server.
Testing the search engine in the published Web site
- In Engineering Method Composer publish a configuration with the Lucene search capability to a folder on your drive, for example, small-rup. For more information see: Publishing configurations as Web sites.
- Copy the published Web site to the htdocs folder
under your Apache installed directory.Tip: You can also copy the published site under any configured document root directory.
- Open your browser and enter the URL of your published site, such as: http://localhost/small-rup/index.htm.
- Enter some search terms in the search field to test your search engine.
Installing and configuring Apache, PHP, and Zend and deploying the Engineering Method Composer Web sites on Linux
To install and configure Apache, PHP, and Zend follow these steps:
Install
Apache
- Download Apache 2.x (For example, httpd-2.4.29.tar.gz) from http://httpd.apache.org/download.cgi.
- Extract the package and install Apache 2.x using the following
commands.
[root@localhost root]#tar -zxvf httpd-2.4.29.tar.gz [root@localhost root]#cd httpd-2.4.29 [root@localhost root]#./configure --prefix=/usr/local/apache --enable-module=so [root@localhost root]#make [root@localhost root]#make install
Install PHP
- Download PHP 7.1.x (For example, php-7.1.12.tar.gz) from http://www.php.net/.
- Extract and install PHP 7.1.x using the following commands:
[root@localhost root]#tar -zxvf php-7.1.12.tar.gz [root@localhost root]#cd php-7.1.12 [root@localhost root]#./configure --prefix=/usr/local/php --with-apxs2=usr/local/apache/bin/apxs --with-xsl --with-config-file-path=/usr/local/php/lib --enable-mbstring [root@localhost root]#make [root@localhost root]#make install [root@localhost root]#cp php.ini-dist /usr/local/php/lib/php.iniNotes for ./configure options:
--prefix: PHP installed path
-–with-apxs2: the location of your Apache installed folder (For example, /usr/local/apache/bin/apxs)
-–with-config-file-path: the location of your php.ini
-–enable-mbstring: enable multi-byte string
-–with-xsl: xsl supported by PHP
Note: If you do not have libxml2 and libxslt packages
installed and you get configure error, you must first download and
install these packages (For example, libxml2-2.6.23.tar.bz2 and libxslt-1.1.15.tar.bz2)
before configuring again.
Integrate Apache with PHP
- Go to your Apache installed location. Find and edit httpd.conf and
ensure that you have the following configurations:
LoadModule php5_module modules/ libphp5.so AddType application/x-httpd-php .php .phtml .php3 DirectoryIndex index.html index.htm index.php - Restart the Apache Web server after editing httpd.conf.
- Test the Apache and PHP integration:
- Create a file named phpinfo.php with the following
simple content:
<?php phpinfo(); ?>
- Create a file named phpinfo.php with the following
simple content:
- Save the PHP file in the htdocs folder under the Apache installed directory.
- Open your browser and enter the following URL address: http://localhost/phpinfo.php. The resulting page displays the PHP Version information.
Configure Zend
- Download ZendFramework-1.8.2.tar.gz from http://framework.zend.com/.
- Extract the tar file (with tar -zxvf command) into a folder on your drive (For example, /usr/local/ZendFramework-1.8.2).
Configure Zend and PHP
- Open the PHP configuration file (php.ini) in
the PHP installed directory for editing and add the following lines:
include_path=".;/usr/local/ZendFramework-1.8.2/library/" (Adjust the path according to your Zend installation directory.) session.auto_start=1 error_reporting=E_ALL&~E_NOTICE - Save and close the php.ini file.
- Restart the Apache Web server.
Testing the search engine in the published Web site
- In Engineering Method Composer publish a configuration with the Lucene search capability to a folder on your drive, for example, small-rup. For more information see: Publishing configurations as Web sites.
- Copy the published Web site to the htdocs folder
under your Apache installed directory.Tip: You can also copy the published site under any configured document root directory.
- Find the "index" folder under the published Web site (for example, /usr/local/apache/htdocs/small-rup/search and
grant write permission for the daemon group:
chown -R daemon.daemon index chmod g+xw index - Open your browser and enter the following URL address: http://localhost/small-rup/index.htm.
- Enter some search terms in the search field to test your search engine.
Installing and configuring IIS, PHP, and Zend and deploying the Engineering Method Composer Web sites
To install and configure Internet Information Services (IIS), PHP, and Zend follow these steps:
Install IIS
- Open Add/Remove Windows Components in Control Panel > Add or Remove Programs.
- Install Internet Information Services (IIS) by using the
default installation settings.Remember: You might need your Windows OS installation media.
Install FastCGI extension for IIS
- Download FastCGI (fcgisetup32.msi) form http://www.microsoft.com/downloads.
- Double-click fcgisetup32.msi and install FastCGI.Tip: For IIS 6, if you check “Web Service Extensions” in IIS manager, “FastCGI handler” are displayed in the list.
Install PHP
- Download PHP 7.1.x non thread safe package (For example, php-7.1.12-nts-Win32-VC14-x86.zip) from http://www.php.net/.
- Install PHP 7.1.x with the following settings:
- Select the “IIS FastCGI” in “Web Server Setup” page
- In the next page, select the corresponding Apache server configuration directory
- Select to install the following two extensions in the "Choose
Item to Install" page:
- Multi-Byte String
- XSL
To configure FastCGI to work with PHP:
- Go to C:\Windows\system32\inetsrv and open fastcgi.ini for editing.
- Ensure that you have the following configurations:
[Types] php=PHP [PHP] ExePath=C:\Program Files\php\php-cgi.exe InstanceMaxRequests =10000 ActivityTimeout=300 RequestTimeout=300 EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000,PHPRC:C:\Program Files\PHP\
Configure IIS and test the PHP integration
- Open IIS Manager, right-click IIS default Web site and select Properties.
- Click the Home Directory tab and click Configuration.
- Click Add and then add C:\Windows\system32\inetsrv\fcgiext.dll into the Executable field.
- Complete the rest of fields as per the figure below:

- Restart IIS.
- Create a file named phpinfo.php with the following
simple content:
<?php phpinfo(); ?> - Save the PHP file in the default web root folder (For example, C:\inetput\wwwroot).
- Open your browser and enter the following URL address: http://localhost/phpinfo.php. The resulting page displays the PHP Version information.
Configure Zend
- Download ZendFramework-1.8.2.zip from http://framework.zend.com/.
- Extract the .zip file into a folder on your drive (For example, D:\ZendFramework-1.8.2).
Configure Zend and PHP
- Open the PHP configuration file (php.ini) in
the PHP installed directory for editing and add the following lines:
include_path=".;D:\ZendFramework-1.8.2\library\" (Adjust the path according to your Zend installation directory.) error_reporting=E_ALL&~E_NOTICE [PHP_MBSTRING] extension=php_mbstring.dll [PHP_XSL] extension=php_xsl.dll - Save and close the php.ini file.
- Restart the IIS server.
Testing the search engine in the published Web site
- In Engineering Method Composer publish a configuration with the Lucene search capability to a folder on your drive, for example, small-rup. For more information see: Publishing configurations as Web sites.
- Create a Virtual directory and point it to the published Web site folder. Ensure that the Execute option (such as ISAPI applications or CGI) in the Access Permission page is checked.
- Find the "index" folder under the published Web site folder (For example, C:\inetpub\wwwroot\small-rup\search\) and grant both write and execute permissions to the "internet guest account user. (For example, IUSR_$HostName)
- Open your browser and enter the following URL address: http://localhost/small-rup/index.htm.
- Enter some search terms in the search field to test your search engine.