PHP
  Home arrow PHP arrow Page 7 - Executing Microsoft SQL Server Stored Proc...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Executing Microsoft SQL Server Stored Procedure from PHP on Linux
By: Jack Zhang
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 31
    2003-10-20

    Table of Contents:
  • Executing Microsoft SQL Server Stored Procedure from PHP on Linux
  • Preparation
  • Installing the Apache Web Server
  • Installing the Apache Web Server, Cont'd
  • Installing FreeTDS
  • Modify the PHP Source Code
  • Modify the PHP Source Code, Cont'd
  • Executing MS SQL Server Procedures from PHP
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Executing Microsoft SQL Server Stored Procedure from PHP on Linux - Modify the PHP Source Code, Cont'd


    (Page 7 of 9 )

    According to the PHP documentation, we need to append  these options to the configure command:

    --with-mssql=/usr/local/FreeTDS  --with-apxs2filter =/usr/local/Apache2/bin/apxs

    The following is my actual command to configure PHP 4.3.3:

    ./configure --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --target=i686-redhat-linux-gnu --prefix=/usr/local/php --with-config-file-path=/usr/local/php  --enable-force-cgi-redirect --disable-debug --enable-pic --disable-rpath --enable-inline-optimization  --with-db4 --with-dom=/usr --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --with-gd --enable-gd-native-ttf --with-ttf --with-gdbm --with-gettext --with-ncurses --with-gmp --with-iconv --with-jpeg-dir=/usr  --with-png  --with-regex=system --with-xml --with-expat-dir=/usr --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-discard-path --enable-track-vars --enable-trans-sid  --enable-wddx  --with-mssql=/usr/local/FreeTDS --with-pcre-regex    --with-mysql=shared  --enable-memory-limit --enable-bcmath --enable-shmop --enable-versioning --enable-calendar --enable-dbx --enable-dio --enable-mcal --disable-cli --with-apxs2filter=/usr/local/Apache2/bin/apxs

    If there is no error, we can compile PHP4.3.3 by issuing:

    make

    If there is no error, install PHP 4.3.3 as follows:

    make install

    Check the /usr/local/ folder, you can see the newly installed php folder there. 
    Use an editor to open the Apache configuration file as we did in the beginning of this article:

    gedit /usr/local/apache2/conf/httpd.conf

    Search the following line:

    LoadModule php4_module modules/libphp4.so

    After the above line, add the following code:

    AddType application/x-httpd-php .php

    Then save the file.

    Now issue the following command if you’ve setup Apache as a service:

    service httpd restart

    If you haven’t set it up as a service, you need to restart Apache by issuing the following command:

    /usr/local/apache2/bin/apachectl restart

    Now PHP is ready to work!  Let’s test it. Open an editor window by issuing the following command:

    gedit

    Input the following contents:

    <?php
    phpinfo();
    ?>

    And save as a new file, called test.php in the /usr/local/apache2/htdocs folder.

    Now load up your browser and input http://localhost/test.php in the address bar.  You will see the PHP information page.

    Scroll down the screen, you will see a section on Microsoft SQL Server.

    If you have ever worked with Apache + PHP on Windows, you can compare it with the precompiled PHP that’s installed on Windows.

    The difference between PHP on Windows and our compiled PHP on Linux is:

    On windows, the MS SQL Server support module is running as a DLL file.  In order to enable the extension, must uncomment the line from the php.ini file (also set the correct path for extensions):

    extension=php_mssql.dll

    On Linux,  the MS SQL Server support module is compiled into libphp4.so.  There is no need to load it from extensions, but I still highly recommend you to copy php.ini-recommended from the PHP source code folder into /usr/local/php, and rename it as php.ini.
    Using php.ini, you can easily control all the parameters for the module as needed, and load third party extension modules in the future.

    More PHP Articles
    More By Jack Zhang


     

    PHP ARTICLES

    - Making Usage Statistics in PHP
    - Installing PHP under Windows: Further Config...
    - File Version Management in PHP
    - Statistical View of Data in a Clustered Bar ...
    - Creating a Multi-File Upload Script in PHP
    - Executing Microsoft SQL Server Stored Proced...
    - Code 10x More Efficiently Using Data Access ...
    - A Few Tips for Speeding Up PHP Code
    - The Modular Web Page
    - Quick E-Commerce with PHP and PayPal
    - Regression Testing With JMeter
    - Building an Iterator with PHP
    - PHP Frontend to ImageMagick
    - Using PEAR's mimeDecode Module
    - Incoming Mail and PHP







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    Stay green...Green IT