Databases Reference
In-Depth Information
apache2ctl ; if the examples below don't work for you, try replacing apachectl with
apache2ctl . You can generally start an installed Apache server by using the command:
# apachectl start
If this fails on a Linux or Mac OS X system because the command isn't found, use the
find command to locate the apachectl script file:
# find / -type f -name apachectl
On a Windows system, use the built-in search instead of the find command. If it's
reported as being in, say, /usr/local/apache/bin/apachectl , try starting Apache using that
full path:
# /usr/local/apache/bin/apachectl start
Apache should start, and you should be able to test it by loading the web page http://
localhost in your browser.
You can stop the server by typing:
# apachectl stop
If you make a change to the web server configuration file, you can stop and start the
server in one go by typing:
# apachectl restart
If you have an XAMPP installation, you can more easily start and stop the Apache web
server using the XAMPP control scripts (Linux and Mac OS X) or control panel (Win-
dows). Earlier, we described how to do this alongside our XAMPP installation instruc-
tions for each operating system.
Checking Whether Your Apache Installation Supports PHP
Once you've found your document root and have Apache running, you can check
whether it can serve PHP requests, and whether its PHP engine has support for MySQL.
Using a text editor, create the file phpinfo.php so that it has one line with the following
contents:
<?php phpinfo(); ?>
Save this file with the name phpinfo.php in the document root directory. On a Linux or
Mac OS X system, you can check the file permissions by listing the file, <path_to_docu
ment_root>/phpinfo.php , for example:
$ ls -al /var/www/html/phpinfo.php
-rw------- 1 saied saied 20 Jul 22 11:35 /var/www/html/phpinfo.php
Here, only the user who owns the file ( saied ) has permission to read and write the file.
For the web server to read a file, the file should be readable by everyone. You can set
the appropriate permissions as follows:
$ chmod u=rw,g=r,o=r path_to_document_root/ phpinfo.php
 
Search WWH ::




Custom Search