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
  1. Download Apache 2.x (for example, Apache 2.4.37) from http://httpd.apache.org/download.cgi, and unzip.
  2. You can run Apache directly from the unzip folder, or install Apache as a service.
  3. Stop the Apache Web server.
Install PHP
  1. Download PHP 7.1.x (for example, PHP 7.1.23) from http://www.php.net/, and unzip (for example to C:\PHP)
  2. In a console window, type php -v to see if it worked.
Configure Apache and PHP
  1. 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
  1. Create a file named phpinfo.php with the following simple content:
    <?php
    phpinfo();
    ?>
  2. Save the PHP file in the htdocs folder under the Apache installed directory.
  3. Restart the Apache Web server.
  4. Open your browser and enter the following URL address: http://localhost/phpinfo.php. The resulting page displays the PHP Version information.
Configure Zend
  1. Download ZendFramework-1.8.2.zip from http://framework.zend.com/.
  2. Extract the .zip file into a folder on your drive. (For example, D:\ZendFramework-1.8.2)
Configure Zend and PHP
  1. 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.)
  2. Uncomment the following lines (by removing the leading semicolon of each line):
    extension=php_mbstring.dll
    extension=php_xsl.dll
  3. Save and close the php.ini file.
  4. Restart the Apache Web server.
Testing the search engine in the published Web site
  1. 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.
  2. 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.
  3. Open your browser and enter the URL of your published site, such as: http://localhost/small-rup/index.htm.
  4. 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
  1. Download Apache 2.x (For example, httpd-2.4.29.tar.gz) from http://httpd.apache.org/download.cgi.
  2. 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
  1. Download PHP 7.1.x (For example, php-7.1.12.tar.gz) from http://www.php.net/.
  2. 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.ini

    Notes 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
  1. 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
  2. Restart the Apache Web server after editing httpd.conf.
  3. Test the Apache and PHP integration:
    1. Create a file named phpinfo.php with the following simple content:
      <?php
      phpinfo();
      ?>
  4. Save the PHP file in the htdocs folder under the Apache installed directory.
  5. Open your browser and enter the following URL address: http://localhost/phpinfo.php. The resulting page displays the PHP Version information.
Configure Zend
  1. Download ZendFramework-1.8.2.tar.gz from http://framework.zend.com/.
  2. 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
  1. 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
  2. Save and close the php.ini file.
  3. Restart the Apache Web server.
Testing the search engine in the published Web site
  1. 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.
  2. 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.
  3. 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
  4. Open your browser and enter the following URL address: http://localhost/small-rup/index.htm.
  5. 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
  1. Open Add/Remove Windows Components in Control Panel > Add or Remove Programs.
  2. 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
  1. Download FastCGI (fcgisetup32.msi) form http://www.microsoft.com/downloads.
  2. 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
  1. 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/.
  2. 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:
  1. Go to C:\Windows\system32\inetsrv and open fastcgi.ini for editing.
  2. 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
  1. Open IIS Manager, right-click IIS default Web site and select Properties.
  2. Click the Home Directory tab and click Configuration.
  3. Click Add and then add C:\Windows\system32\inetsrv\fcgiext.dll into the Executable field.
  4. Complete the rest of fields as per the figure below:
    Add/Edit Application Extension Mapping
  5. Restart IIS.
  6. Create a file named phpinfo.php with the following simple content:
    <?php
    phpinfo();
    ?>
  7. Save the PHP file in the default web root folder (For example, C:\inetput\wwwroot).
  8. Open your browser and enter the following URL address: http://localhost/phpinfo.php. The resulting page displays the PHP Version information.
Configure Zend
  1. Download ZendFramework-1.8.2.zip from http://framework.zend.com/.
  2. Extract the .zip file into a folder on your drive (For example, D:\ZendFramework-1.8.2).
Configure Zend and PHP
  1. 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
  2. Save and close the php.ini file.
  3. Restart the IIS server.
Testing the search engine in the published Web site
  1. 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.
  2. 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.
  3. 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)
  4. Open your browser and enter the following URL address: http://localhost/small-rup/index.htm.
  5. Enter some search terms in the search field to test your search engine.

Feedback