Archive for February, 2008

Chapter 16 . PHP Development 455 Figure 16-5:

Friday, February 29th, 2008

Chapter 16 . PHP Development 455 Figure 16-5: Some warnings produced by the PHP configure script When you press Enter, the makeprocess begins. How long it takes depends on the speed and resources available on your machine. Tip If the make process fails this time, don t worry. PHP installation can sometimes be difficult; often the build fails because a library is not found. Normally you can get good clues to what went wrong by closely examining the last few lines of code just before the point at which the build process died. For additional help, try the PHP Web site s section of search functions and FAQs. If you re getting error messages like those in Figure 16-5, chances are someone else has too and there could be a simple fix. If the make process is successful, congratulations! 7. Install the software, using the following command: make install Normally this is the final basic step in the build process. You re not done yet though. In particular, check inside your Apache Web server configuration file (usually called httpd.conf) for some lines like those shown in Figure 16-6.
In case you need quality webspace to host and run your web applications, try our personal web hosting services.

Geocities web hosting - 454 Part IV . Development Figure 16-4: An

Thursday, February 28th, 2008

454 Part IV . Development Figure 16-4: An error that occurs during PHP configuration 5. To tell the PHP configurescript where it can find apxs, be sure to remove the existing config.cache file with the following code: rm config.cache ; ./configure –with-mysql –withapxs=/ usr/local/apache/bin/apxs An error similar to the previous one can occur if the configurescript can t find the necessary MySQL libraries. If that happens, you have two possible fixes: * Add the path as part of the –with-mysql option. * Add the path to /etc/ld.so.conf and run ldconfig. (I ve had better success with this option.) If the configure script runs successfully, congratulations! Although there s more to come, you now have a basic configuration in place to accommodate PHP. You may, however, receive one or more warnings when the configure script completes its run; a couple of these are shown in Figure 16-5. 6. Continue the installation process by building the software; type the following command: make
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.

Chapter 16 . PHP Development 453 Note Figure (Web hosting faq)

Wednesday, February 27th, 2008

Chapter 16 . PHP Development 453 Note Figure 16-3: Unpacking the PHP archive 2. Change into the newly created PHP directory. If you have an existing PHP source directory that you ve previously configured from, be sure to either remove the directory or at remove the config.cache file contained therein. It is at this point where decisions must be made regarding your existing Apache installation as well as other options, you may want to enable with PHP. I ll show an example configuration that enables MySQL on an Apache server that uses Dynamic Shared Objects. 3. To configure PHP in the environment described in Step 2, type ./configure –with-mysql –with-apxs You may receive an error message similar to that in Figure 16-4. 4. If you receive the error message shown in Figure 16-4, note what the message points out and respond accordingly. In this installation, I needed to add the path to the apxs module for Apache. First I needed to find it: find / -name apxs For the example, apxs is located in a couple of places; I chose the one in /usr/local/apache/bin/ (your location may be different).
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.

452 Part IV (Apache web server for windows) . Development Figure 16-2: The

Tuesday, February 26th, 2008

452 Part IV . Development Figure 16-2: The MySQL section of the PHP information page Installing PHP on a Linux system Whether this is your first time installing PHP or a reinstallation (to enable MySQL on a system that already has PHP installed), this section can help. As a prerequisite, you should already have MySQL installed including the libraries for MySQL. In addition, you should have a Web server running. This section examines the installation of PHP with Apache as the Web server software. If your Web server is not Apache, refer to the documentation included with your Web server and with PHP itself for help with installation. Installing and configuring PHP The steps for installing and configuring PHP on a Linux system (with Apache as the Web server) are as follows: 1. Unpack the PHP archive by issuing the following command: tar -zxvf php-.tgz For example, Figure 16-3 shows PHP unpacked to its default directory. Note
Check Tomcat Web Hosting services for best quality webspace to host your web application.

Chapter 16 . PHP Development 451 Figure 16-1:

Monday, February 25th, 2008

Chapter 16 . PHP Development 451 Figure 16-1: A server with PHP enabled and configured correctly If, for whatever reason, the page does not come up, there is probably something wrong with your PHP configuration. Don t worry! I walk through the installation of PHP in this chapter; you can reconfigure as part of the installation process. Scroll down in the PHP information page and look for the section on MySQL, as shown in Figure 16-2. In the example in Figure 16-2, MySQL is enabled with PHP. If your page looks similar, you can skip the sections of this chapter concerned with installing and configuring PHP for use with MySQL. If PHP is installed on your system but MySQL is not enabled, you ll want to reinstall PHP to enable MySQL. Where to get the software The main distribution site for PHP is http://www.php.net. I ve also included PHP on the CD-ROM with this book (the PHP Web site probably has a newer version). On the CD-ROM The CD-ROM with this book includes the latest version of PHP available as of press time. This version works with the examples given in the book.
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

Web host sites - 450 Part IV . Development This section concentrates

Sunday, February 24th, 2008

450 Part IV . Development This section concentrates on installing PHP on a Linux system, using the standard process based on configureand make commands. Your distribution of Linux may have a package-management tool, in which case you may already have a compiled version of PHP and Apache to work with. In addition, you may already have PHP installed, but it may not be MySQL-enabled. If such is the case, you ll need to reinstall a MySQL-enabled version of PHP. Finally, you ll probably have to reconfigure your Web server to work with PHP, so the chapter covers configuring Apache (the standard Linux Web-server software) with PHP. What you need for installation To install a MySQL-enabled version of PHP, you need three essential ingredients on hand: . the PHP software itself . the source code for Apache (or whatever Web server you re running) . the MySQL client libraries First, find out whether you already have PHP installed for use with Apache (and whether it s enabled for MySQL). On the Web server, type the following command: httpd -l Look for a line similar to this one: mod_php4.c If you see that line, congratulations PHP is probably already installed and enabled on your Web server. Alternatively, look for lines like these: Compiled-in modules: http_core.c mod_so.c If you see those lines, then your server is configured to load dynamic modules and you may have PHP support available. Even if you have PHP installed, it may not be MySQL-enabled. To test an existing installation of PHP and simultaneously check it for MySQL support you should build a test PHP page. Simply create a regular file, save it with the filename test.php, and place it in the public html or htdocsfolder, just as you would any page. The file itself needs no more than the following contents: If everything is configured correctly, you should see a page similar to the one in Figure 16-1.
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.

PHP Development Afew years back, I devoted weeks (Web space)

Sunday, February 24th, 2008

PHP Development Afew years back, I devoted weeks to learning the Perl- DBI interface to MySQL so I could create MySQL-Perl applications for use in places other than the Web. When I did start writing Web-based applications, I was so immersed in the DBI that I neglected to look at other MySQL development languages for the Web; I had confidence in Perl as a powerful, stable development language. Then one of my good friends told me I should be using yet another language PHP. Even though I had spent a long time learning the DBI, I dove into PHP an easy and powerful development language in its own right. Why learn PHP? This is a valid question. If you don t need to write Web-based applications for MySQL, then PHP may be of limited usefulness for you. If, however, you do write Web- based applications and need them to interact with MySQL, PHP could be just what you re looking for. PHP is extremely useful for interacting with a MySQL database, is somewhat similar to Perl, and (dare I say) is somewhat intuitive. This chapter examines how to install PHP and make it work with MySQL. I also cover some basic PHP concepts, as well as PHP-MySQL functions. The chapter concludes with a few example applications. (They re a little off the beaten track no Guestbook application examples!) PHP Installation Unfortunately, installing PHP is not nearly as easy as installing the Perl DBI and MySQL DBD. However, the developers of PHP have taken great pains with their documentation; it s some of the best I ve ever seen. This includes documentation of the installation software, as well as further coverage on their Web site, http://www.php.net. 16 1616 CHAPTER …. In This Chapter Installing PHP Getting down to brass tacks with PHP Configuring PHP MySQL Listing PHP MySQL functions Building MySQLenabled applications with PHP ….
Check Tomcat Web Hosting services for best quality webspace to host your web application.

448 Part IV . Development (Fedora web server) On the CD-ROM

Friday, February 22nd, 2008

448 Part IV . Development On the CD-ROM The programs contained in this section are available on the CD-ROM. Present and future expansion The ecommercesite has a start. It s nowhere near ready to go online and take orders. A shopping-cart CGI must be built, as well as more robust inventory capabilities. Using a combination of cookies, knowledge of Perl, and the ideas in this chapter, it shouldn t be too much of a stretch to take the ecommercesite to the next step. Summary The Perl DBI is a generic interface used by many types of RDBMS to enable Perl programs to work with databases. MySQL has a database driver (DBD) to work with the DBI and enable the programmer to write powerful MySQL-enabled Perl programs. . Both the DBI and the DBD for MySQL can be obtained at your nearest CPAN mirror or at http://www.cpan.org. . The DBI takes advantage of handles to enable the developer to communicate with a database server. There are driver handles such as MySQL, database handles for connecting to the database server, and statement handles for working with SQL statements. . The developer using the DBI communicates with the database using an object-oriented approach. Database handles are created manually by the user and can be destroyed by the user or automatically by Perl. . The DBI also includes configurable error checking. By default, error checking is automatic. The programmer can control whether error checking is manual, automatic, or a combination of both even within the same program. . The DBI includes many functions for working with databases, not just MySQL. These include functions to retrieve data such as fetchrow, fetchrow_array, and others. . The DBI enables the Perl programmer to combine the power of Perl with the features of MySQL to make applications that run from the command line or in a CGI for the Web. …
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.

Chapter 15 . Perl Development 447 Figure 15-55: (How to cite a web site)

Thursday, February 21st, 2008

Chapter 15 . Perl Development 447 Figure 15-55: The full search page in action Finally, if no results are found, that notification is sent to the visitor as well, as shown in Figure 15-56. Figure 15-56: The page when no results are found
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.

Web server address - 446 Part IV . Development As with other

Wednesday, February 20th, 2008

446 Part IV . Development As with other programs shown as examples, this one could always be improved say, with better error checking and handling, as well as with more robust searching capabilities. But you get the idea. The program works in much the same way as the inventory program; it gets parameters from the incoming form and places them into variables. From there, it makes a decision based on which button was selected (simple search or more complicated search). Notice that during the while loop to retrieve results a decision is made based upon the quantity on hand of the given product. Aside from that (and a bit of Perl here and there to make things work correctly), you have a fully functional search engine. An example of the simple search result is shown in Figure 15-54. Figure 15-54: Results from the simple search The more complicated search uses an AND if both the product name and artist are filled in. A sample result is shown in Figure 15-55.
If you are in need for chaep and reliable webhost to host your website, our recommendation is http web server services.