{"id":12135,"date":"2019-03-22T11:39:28","date_gmt":"2019-03-22T11:39:28","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=12135"},"modified":"2019-03-22T11:39:28","modified_gmt":"2019-03-22T11:39:28","slug":"how-to-find-mysql-php-and-apache-configuration-files","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/22\/how-to-find-mysql-php-and-apache-configuration-files\/","title":{"rendered":"How to Find MySQL, PHP and Apache Configuration Files"},"content":{"rendered":"<p>In this post, we will learn a number of commands for locating the default configuration files for\u00a0<strong>MySQL<\/strong>\u00a0database server\u00a0<code>(my.conf)<\/code>, PHP programming language\u00a0<code>(php.ini)<\/code>\u00a0and Apache HTTP server\u00a0<code>(http.conf)<\/code>, which together with Linux form the\u00a0<a href=\"https:\/\/www.tecmint.com\/tag\/lamp\/\" target=\"_blank\" rel=\"noopener\">LAMP (Linux Apache Mysql\/MariaDB PHP)<\/a>\u00a0stack.<\/p>\n<p>A configuration file (or config file) contains system related or application settings. It gives developers and administrators control over operation of the system or an application.<\/p>\n<p>As a Linux Sysadmin, knowing the location of configuration files or mastering means of finding them is an invaluable skill.<\/p>\n<p>In\u00a0<a href=\"https:\/\/www.tecmint.com\/linux-directory-structure-and-important-files-paths-explained\/\" target=\"_blank\" rel=\"noopener\">Linux Directory Structure<\/a>, the\u00a0<code>\/etc<\/code>\u00a0directory or its sub-directories store system related or application configuration files.<\/p>\n<p>Although this is the primary location of configuration files, a few developers choose to store other configuration files in custom directories.<\/p>\n<h3>How To Find MySQL (my.conf) Configuration File<\/h3>\n<p>You can locate the the MySQL configuration file using the\u00a0<a href=\"https:\/\/www.tecmint.com\/gliding-through-database-mysql-in-a-nutshell-part-i\/\" target=\"_blank\" rel=\"noopener\">mysql command line tool<\/a>\u00a0or\u00a0<a href=\"https:\/\/www.tecmint.com\/mysqladmin-commands-for-database-administration-in-linux\/\" target=\"_blank\" rel=\"noopener\">mysqladmin<\/a>, a client for managing a MySQL server.<\/p>\n<p>The following commands will display the\u00a0<strong>mysql<\/strong>\u00a0or\u00a0<strong>mysqladmin<\/strong>\u00a0help page, which includes a section that talks about the files (configuration files) from which default options are read.<\/p>\n<p>In the commands below, the\u00a0<strong>grep<\/strong>\u00a0option\u00a0<code>-A<\/code>\u00a0displays NUM lines of trailing context after matching lines.<\/p>\n<pre>$ mysql --help | grep -A1 'Default options'\r\nOR\r\n$ mysqladmin --help | grep -A1 'Default options'\r\n<\/pre>\n<div id=\"attachment_23926\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Find-Mysql-Configuration-File.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23926\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Find-Mysql-Configuration-File.png\" alt=\"Find MySQL my.cnf Configuration File\" width=\"739\" height=\"205\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Find MySQL my.cnf Configuration File<\/p>\n<\/div>\n<p>Make an effort to master the MySQL administration through these helpful articles.<\/p>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/learn-mysql-mariadb-for-beginners\/\" target=\"_blank\" rel=\"noopener\">Learn MySQL for Beginners Guide \u2013 Part 1<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/learn-mysql-mariadb-advance-functions-sql-queries\/\" target=\"_blank\" rel=\"noopener\">Learn MySQL for Beginners Guide \u2013 Part 2<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/mysqladmin-commands-for-database-administration-in-linux\/\" target=\"_blank\" rel=\"noopener\">20 Useful Mysqladmin Commands for Database Administration<\/a><\/li>\n<\/ol>\n<h3>How To Find PHP (php.ini) Configuration File<\/h3>\n<p><strong>PHP<\/strong>\u00a0can be controlled from the terminal using\u00a0<a href=\"https:\/\/www.tecmint.com\/execute-php-codes-functions-in-linux-commandline\/\" target=\"_blank\" rel=\"noopener\">php command line utility<\/a>, in conjunction with the\u00a0<code>-i<\/code>\u00a0switch which enables showing of PHP information and configurations and\u00a0<a href=\"https:\/\/www.tecmint.com\/12-practical-examples-of-linux-grep-command\/\" target=\"_blank\" rel=\"noopener\">grep command<\/a>\u00a0help you to can find the PHP configuration file like so:<\/p>\n<pre>$ php -i | grep \"Loaded Configuration File\"\r\n<\/pre>\n<div id=\"attachment_23927\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Find-PHP-Configuration-File.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23927\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Find-PHP-Configuration-File.png\" alt=\"Find PHP (php.ini) Configuration File\" width=\"608\" height=\"142\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Find PHP (php.ini) Configuration File<\/p>\n<\/div>\n<h3>Find Apache http.conf\/apache2.conf Configuration File<\/h3>\n<p>You can invoke\u00a0<strong>apache2<\/strong>\u00a0directly (which is not recommended in most cases) or administer it using\u00a0<strong>apache2ctl<\/strong>control interface as below with the\u00a0<code>-V<\/code>\u00a0flag which shows the version and build parameters of apache2:<\/p>\n<pre>--------- On CentOS\/RHEL\/Fedora ---------\r\n$ apachectl -V | grep SERVER_CONFIG_FILE\r\n\r\n--------- On Debian\/Ubuntu\/Linux Mint ---------\r\n$ apache2ctl -V | grep SERVER_CONFIG_FILE\r\n<\/pre>\n<div id=\"attachment_23928\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Find-Apache-Configuration-File.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23928\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Find-Apache-Configuration-File.png\" alt=\"Find Apache Configuration File\" width=\"586\" height=\"57\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Find Apache Configuration File<\/p>\n<\/div>\n<p>That\u2019s all! Remember to share your thoughts about this post or provide us other possible ways of locating the above configuration files in the comments.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/find-mysql-php-apache-configuration-files\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, we will learn a number of commands for locating the default configuration files for\u00a0MySQL\u00a0database server\u00a0(my.conf), PHP programming language\u00a0(php.ini)\u00a0and Apache HTTP server\u00a0(http.conf), which together with Linux form the\u00a0LAMP (Linux Apache Mysql\/MariaDB PHP)\u00a0stack. A configuration file (or config file) contains system related or application settings. It gives developers and administrators control over operation of &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/22\/how-to-find-mysql-php-and-apache-configuration-files\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Find MySQL, PHP and Apache Configuration Files&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12135","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=12135"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12135\/revisions"}],"predecessor-version":[{"id":12136,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12135\/revisions\/12136"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=12135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=12135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=12135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}