PHP
  Home arrow PHP arrow Page 4 - 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 - Installing the Apache Web Server, Cont'd


    (Page 4 of 9 )

    In a real production environment, we would like Apache running as a service, meaning that whenever our machine starts-up, these services will startup automatically.  Copy and paste the following script and save it as httpd in the /etc/init.d folder.

    #!/bin/bash
    #
    # Startup script for the Apache Web Server
    #
    # chkconfig: - 85 15
    # description: Apache is a World Wide Web server.  It is used to serve \
    #        HTML files and CGI.
    # processname: httpd
    # pidfile: /var/run/httpd.pid
    # config: /usr/local/apache2/conf/httpd.conf

    # Source function library.
    . /etc/rc.d/init.d/functions


    # This will prevent initlog from swallowing up a pass-phrase prompt if
    # mod_ssl needs a pass-phrase from the user.
    INITLOG_ARGS=""

    # Path to the Apachectl script, server binary, and short-form for messages.
    apachectl=/usr/local/apache2/bin/apachectl
    httpd=/usr/local/apache2/bin/httpd
    prog=httpd
    RETVAL=0


    # The semantics of these two functions differ from the way Apachectl does
    # things -- attempting to start while running is a failure, and shutdown
    # when not running is also a failure.  So we just do it the way init scripts
    # are expected to behave here.
    start() {
            echo -n $"Starting $prog: "
            daemon $httpd $OPTIONS
            RETVAL=$?
            echo
            [ $RETVAL = 0 ] && touch /var/lock/subsys/httpd
            return $RETVAL
    }
    stop() {
     echo -n $"Stopping $prog: "
     killproc $httpd
     RETVAL=$?
     echo
     [ $RETVAL = 0 ] && rm -f /var/lock/subsys/httpd /var/run/httpd.pid
    }
    reload() {
     echo -n $"Reloading $prog: "
     check13 || exit 1
     killproc $httpd -HUP
     RETVAL=$?
     echo
    }

    # See how we were called.
    case "$1" in
      start)
     start
     ;;
      stop)
     stop
     ;;
      status)
            status $httpd
     RETVAL=$?
     ;;
      restart)
     stop
     start
     ;;
      condrestart)
     if [ -f /var/run/httpd.pid ] ; then
      stop
      start
     fi
     ;;
      reload)
            reload
     ;;
      graceful|help|configtest|fullstatus)
     $Apachectl $@
     RETVAL=$?
     ;;
      *)
     echo $"Usage: $prog {start | stop | restart | condrestart | reload | status | fullstatus | graceful | help | configtest}"
     exit 1
    esac

    exit $RETVAL

    Then issue the following command:

    chkconfig httpd --level 345 on

    This will set Apache to start on Linux level 3 4 and 5 automatically –  (by default, Red Hat is running on level 5 with X windows, most production machines will choose level 3, without GUI).

    Reboot the machine; you can test it in the browser, now Apache web server starts up automatically with the machine reboot.

    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 4 Hosted by Hostway
    Stay green...Green IT