Installing and Configuring Apache, PHP and MySQL

Help on getting these three powerhouses playing well together.
Testing PHP

Now that everything was installed, it was time to see if PHP actually worked. For that I created the following simple page:

<HTML><\n>
<HEAD><TITLE>PHP Test</TITLE></HEAD>
<BODY>
<?phpinfo() ?>
</BODY>
</HTML>

Notice that PHP commands are contained by <? and ?> tags. I saved the file as test.php in Apache's htdocs directory and aimed my browser at http://localhost/test.php A page appeared with the PHP logo and quite a bit of information about my PHP configuration, so I knew that PHP was working. If you see <?phpinfo() ?> and nothing else, make sure that the line in httpd.conf that adds the PHP type to Apache is uncommented and that Apache has been restarted. If your problems persist, both the Apache and PHP web sites contain information on using PHP and Apache together.

Conclusion

Once I knew that Apache and PHP were working, I installed the PHP calendar program that I had chosen by simply copying its PHP files into a directory under Apache's htdocs directory. I now had a web server, a very powerful HTML embedded scripting language and a calendar system. In addition to costing nothing, I also have the source code for all the software so I can see how they work.

Ralph Krause runs a one-man computer and web consulting service and lives in Michigan. He has been using Linux for a couple of years now and plans never to stop.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Thanks for your help

Anonymous's picture

Hello,

Actually your article doesnt help me out much am stuck with the configuration of my apache. I want to start it on port 2083 but by default its on port80 which is administrator port. YOu can help me to change the port for the same.

http://forums.techarena.in/guides-tutorials/1346315.htm

my php is unable to process the mysql

Anonymous's picture

I have configured my php, mysql and apache and it works fine for the php scripts ... But when i included scripts for mysql processing in it ... It dint work .... I checked for the phpinfo and it showed --with-mysql ... Can u please help me .... when ever i access codes with mysql in it ... The server does'nt process it . Is there any other configuration changes i need to make in any of them .. I am using the fedora core 2 system ...

The sample php code for the mysql that i have written is :
Name: ".result_row['name'] . " ";
?>

For the database mydb and the UserSessions,which were created earlier

Apache, Php & Mysql

Webmonster's picture

I need help on how to configure apaches, Php and mysql on Win 98.

Your article does not help me onthat.

Pls do justice to this. Thanks

Webmonster

Hey, you need to search a goo

krienaz's picture

Hey, you need to search a google for easyphp software. It's everyting in one install as if it had been created for a blondie. :) Regards!

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix