简体   繁体   中英

Apache config parser for PHP

I am looking for some PHP utility that parses Apache configuration files similar to this Perl's module: http://metacpan.org/pod/Apache::ConfigParser

Any clues?

PEAR::Config supports Apache-style config files.
Have a look at the manual http://pear.php.net/manual/en/package.configuration.config.avail-container.apache.php

$conf = new Config();
$root = $conf->parseConfig("/etc/apache2/httpd.conf", "apache");
print current($root->getItem('directive', 'Listen'))->content;

Or something like that..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM