Comments on: How to Find MySQL, PHP and Apache Configuration Files https://www.tecmint.com/find-mysql-php-apache-configuration-files/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Thu, 13 Jul 2023 21:28:34 +0000 hourly 1 By: Aaron Kili https://www.tecmint.com/find-mysql-php-apache-configuration-files/comment-page-1/#comment-851605 Thu, 22 Dec 2016 09:19:32 +0000 http://www.tecmint.com/?p=23925#comment-851605 In reply to LempStacker.

@LempStacker

These are great alternatives as well for Awk users, many thanks for sharing these commands with us.

]]>
By: LempStacker https://www.tecmint.com/find-mysql-php-apache-configuration-files/comment-page-1/#comment-850893 Wed, 21 Dec 2016 10:17:49 +0000 http://www.tecmint.com/?p=23925#comment-850893 I just use command awk and sed, check configuration file of mysql, php, nginx

Check MySQL Configuration File.

[flying@lempstacker ~]$ mysql --help | awk '$0~/Default options/{getline;print}'
/etc/my.cnf ~/.my.cnf

[flying@lempstacker ~]$ mysqladmin --help | awk '$0~/Default options/{getline;print}'
/etc/my.cnf ~/.my.cnf 

Check PHP Configuration File.

[flying@lempstacker ~]$ php -i | awk '$0~/^Loaded Configuration File/{print $NF}'
/etc/php.ini

Check Nginx Configuration File.

[flying@lempstacker ~]$ nginx -V 2>&1 | sed -r -n 's@.*conf-path=(.*) --error.*@\1@p'
/etc/nginx/nginx.conf
]]>