[PHP] Re: NameVirtualHost breaks PHP
Can you indicate Apache settings regarding php and virtualhosts? -- Kind regards, Yuri. www.AceHoster.com Quality web hosting Greg Blakely [EMAIL PROTECTED] ???/ ? ?: [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello. I'm new to this list, though not new to PHP. I'm hoping that my question hasn't been answered a thousand times before, and I did at least search on NameVirtualHost and read all those archived messages before getting to this point. I have an Apache web server (1.0.38) that has been peacefully co-existing with php4 for quite some time. I've interfaced it to mySQL, and life was great. Then, I came up with the brilliant idea to used Named Virtual Hosts rather than using up all my IP addresses. I did all according to the instructions I had, and the virtual part of things worked fine. www.hostone.net showed its proper page, as did www.hosttwo.net. But It broke php. When I go to a php page now, it show's the code rather than executing it. I've verified that this behavior happens across all the web pages, incuding the main one that isn't virtualized. Can anyone point me in the right direction? Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: NameVirtualHost breaks PHP
Yuri Petro asked: Can you indicate Apache settings regarding php and virtualhosts? In the main server configuration area, I have: # The following is for PHP4 (conficts with PHP/FI, below): IfModule mod_php4.c AddType application/x-httpd-php .php4 .php3 .phtml .php AddType application/x-httpd-php-source .phps /IfModule # The following is for PHP3: IfModule mod_php3.c AddType application/x-httpd-php3 .php3 AddType application/x-httpd-php3-source .phps /IfModule # The following is for PHP/FI (PHP2): IfModule mod_php.c AddType application/x-httpd-php .phtml /IfModule ### and the, further on down, there is: NameVirtualHost * ### and then, under the VirtualHost area, I have: VirtualHost * Port 80 AddType application/x-httpd-php .php4 .php3 .phtml .php AddType application/x-httpd-php-source .phps ServerAdmin [EMAIL PROTECTED] DocumentRoot /home/tcrc/www/forum ServerName forum.tcrconline.com ErrorLog /home/tcrc/logs/error_log CustomLog /home/tcrc/logs/access_log combined /VirtualHost ### ### By the way, I tried it with and without the AddType statements in the VirtualHost area. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: NameVirtualHost breaks PHP
You need to specify IP address in NameVirtualHost directive: NameVirtualHost 127.0.0.1 VirtualHost 127.0.0.1:80 DocumentRoot /home/tcrc/www/forum ServerName forum.tcrconline.com ErrorLog /home/tcrc/logs/error_log CustomLog /home/tcrc/logs/access_log combined /VirtualHost -- Kind regards, Yuri. www.AceHoster.com Quality web hosting Greg Blakely [EMAIL PROTECTED] ???/ ? ?: [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Yuri Petro asked: Can you indicate Apache settings regarding php and virtualhosts? In the main server configuration area, I have: # The following is for PHP4 (conficts with PHP/FI, below): IfModule mod_php4.c AddType application/x-httpd-php .php4 .php3 .phtml .php AddType application/x-httpd-php-source .phps /IfModule # The following is for PHP3: IfModule mod_php3.c AddType application/x-httpd-php3 .php3 AddType application/x-httpd-php3-source .phps /IfModule # The following is for PHP/FI (PHP2): IfModule mod_php.c AddType application/x-httpd-php .phtml /IfModule ### and the, further on down, there is: NameVirtualHost * ### and then, under the VirtualHost area, I have: VirtualHost * Port 80 AddType application/x-httpd-php .php4 .php3 .phtml .php AddType application/x-httpd-php-source .phps ServerAdmin [EMAIL PROTECTED] DocumentRoot /home/tcrc/www/forum ServerName forum.tcrconline.com ErrorLog /home/tcrc/logs/error_log CustomLog /home/tcrc/logs/access_log combined /VirtualHost ### ### By the way, I tried it with and without the AddType statements in the VirtualHost area. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: NameVirtualHost breaks PHP
On 28 Apr 2002 at 16:11, Greg Blakely wrote: Can you indicate Apache settings regarding php and virtualhosts? In the main server configuration area, I have: [etc] ### and then, under the VirtualHost area, I have: VirtualHost * Port 80 AddType application/x-httpd-php .php4 .php3 .phtml .php AddType application/x-httpd-php-source .phps ServerAdmin [EMAIL PROTECTED] DocumentRoot /home/tcrc/www/forum ServerName forum.tcrconline.com ErrorLog /home/tcrc/logs/error_log CustomLog /home/tcrc/logs/access_log combined /VirtualHost get rid of the AddType lines in your virtual host definition. You don't need them. Settings in your main config area will be inherited by your virtual host config. When you change this stuff, don't forget to restart apache for the changes to take effect. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php