In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
How to configure apache, php, mysql on RedHatEnterpriseLinux5.3, I believe that many inexperienced people are at a loss about this. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
When installing RedHatEnterpriseLinux5.3, choose to install apache,php,mysql.
Apache
The configuration file for apache is in / etc/httpd/conf/httpd.conf. You can configure the document directory, Listen port, etc. The default document directory is / var/www/html, and the default Listen port is 80.
Apachectl start/stop is used to start / stop apache. You can use apachectl status to see if the WEB service is started. You can also use ps-ef | grep httpd to see if the apache service is started.
Php
Php works as a plug-in to apache. After php is installed, the request for the html file is processed by apache and returned to the browser, and the request for the php file apache is handed over to php and returned to the browser.
The configuration file for php is in / etc/php.ini. For ease of debugging, we can set the display_errors to On. In this way, php runtime errors will be displayed in the browser.
The configuration file of php itself in apache is in / etc/httpd/conf.d/ php.conf.
Php does not support calling mysql API after php is installed by default. You also need to install the php-mysql*.rpm package (or compile php yourself and bring mysql support with configure). After installation, mysql-related API such as mysql_connect and mysql_query can be called in the php script. After installation, the php configuration file for mysql is included in / etc/php.d.
Mysql
Service mysqld start/stop can be used to start / stop the mysql service. The mysqladmin command can be used to manage mysqld, such as creating a database, deleting a database, viewing mysqld status, and so on.
The configuration file for the mysql service is in / etc/my.cnf. The datadir is used to configure the directory where the database file is saved. The default save directory is / var/lib/mysql.
Mysql client is a command-line console that connects to mysql services, either local or remote. To connect to the local service, simply execute the mysql command. After entering console, you can execute sql statements such as create database/table, drop database/table, select, update and delete. You can also execute some mysql commands show databases, show tables, use database, show status, etc.
When you execute show databases in mysql client, you can see that mysql includes three databases by default, which are information_schema,mysql and test. Among them, information_schema and mysql are used by mysql RDBMS itself. Use use mysql to enter the context of the mysql database. You can view the included tables with show tables. The user table is used to hold users who connect to the mysql database. You can use describe user to view the schema of the table. With select host, user, password from user;, you can get only root users by default, and the password is empty. To connect to a database in mysql in a php script, you need to specify host, user, and password.
Here is a php file that uses the mysql database. It allows you to verify that apache,php,mysql is working at the same time.
Test MySQLVariable_nameValue
After reading the above, have you mastered how to configure apache, php and mysql on RedHatEnterpriseLinux5.3? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.