Page 1 of 1

How to add Include to C:\xampp\apache\conf\httpd.conf

PostPosted: 12. September 2009 17:00
by shinokada
I want to include the following. But it does not work. How can I do it?

Include htdocs/phpweb20/httpd.conf

In Linux, it is like this.

Include /var/www/phpweb20/httpd.conf

Thanks in advance.

Re: How to add Include to C:\xampp\apache\conf\httpd.conf

PostPosted: 12. September 2009 17:09
by dmphotography
Include "C:/xampp/htdocs/phpweb20/httpd.conf"

But this isn't a good idea or good practice for that matter.
You should NEVER have configuration files in your htdocs folder. I recommend putting it in any folder before htdocs. In XAMPP, the ideal place would be xampp/apache/conf/extra .

The second issue is why are you including a second file named httpd.conf?
Why not either change the values in /xampp/apache/conf/httpd.conf to match the file you're trying to include or add the values that don't already exist in the default httpd.conf to the existing one?

Re: How to add Include to C:\xampp\apache\conf\httpd.conf

PostPosted: 12. September 2009 17:14
by shinokada
I am trying to add the following to httpd.conf.

Code: Select all
<VirtualHost 192.168.0.80>
    ServerName phpweb20
    DocumentRoot C:\xampp\htdocs\phpweb20

    <Directory "C:\xampp\htdocs\phpweb20">
        AllowOverride All
        Options All
    </Directory>

    php_value include_path .:C:\xampp\htdocs\phpweb20\include:C:\xampp\php\pear\
    php_value magic_quotes_gpc off
    php_value register_globals off
</VirtualHost>

Re: How to add Include to C:\xampp\apache\conf\httpd.conf

PostPosted: 12. September 2009 17:51
by dmphotography
shinokada wrote:I am trying to add the following to httpd.conf.

Code: Select all
<VirtualHost 192.168.0.80>
    ServerName phpweb20
    DocumentRoot C:\xampp\htdocs\phpweb20

    <Directory "C:\xampp\htdocs\phpweb20">
        AllowOverride All
        Options All
    </Directory>

    php_value include_path .:C:\xampp\htdocs\phpweb20\include:C:\xampp\php\pear\
    php_value magic_quotes_gpc off
    php_value register_globals off
</VirtualHost>


That's not where you add that. Open up /xampp/apache/conf/extra/httpd-vhosts.conf and it goes there.
You also need to try writing it more like this:
Code: Select all
<VirtualHost *:80>
    ServerName phpweb20
    DocumentRoot C:\xampp\htdocs\phpweb20
    <Directory "C:\xampp\htdocs\phpweb20">
        AllowOverride All
        Options All
    </Directory>
</VirtualHost>


The additional values you set are not necessary.

php_value magic_quotes_gpc off
php_value register_globals off

These are already set to off by default in XAMPP. You can find them in /xampp/php/php.ini .

I hope that helps.