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!

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState