Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-17-2011, 12:28 PM   PM User | #1
ptrcao
Regular Coder

 
Join Date: Dec 2010
Location: Australia
Posts: 356
Thanks: 143
Thanked 0 Times in 0 Posts
ptrcao is an unknown quantity at this point
subdomain not being php-parsed

a subdomain directory is treated as a root in its own right, right?

well i have www.domain.com

and now i've set up

http://forums.domain.com as well (the directory of which is domain/forums)

php parsing is fine for www.domain.com
but it appears php is not being parsed in http://forums.domain.com

what do you think's going on, and how do i fix this?

Edit: Ok, I suspect is has something to do with .htaccess. I read somewhere GoDaddy does not allow .htaccess in subdirectory-based subdomains. But I thought that since forums.domain's root actually lies under domain (in domain/forum) that all of .htaccess settings would also apply to the subdirectory for my subdomain...
__________________
The website I am building is http://www.mathannotated.com. My questions often pertain to it. This is my site plan: http://www.mathannotated.com/images/...ctory-tree.gif
Thank you for your help in all matters. All earnest efforts in helping me will be credited with Thanks. -ptrcao

Last edited by ptrcao; 02-17-2011 at 04:33 PM..
ptrcao is offline   Reply With Quote
Old 02-17-2011, 01:30 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,644
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
This sounds like a webserver configuration problem to me, not a PHP one. Have you checked with your host on configurations (or reviewed your own if you host)?
Is the subdomain a part of your public_html, or is it served outside of it?
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Old 02-17-2011, 01:36 PM   PM User | #3
ptrcao
Regular Coder

 
Join Date: Dec 2010
Location: Australia
Posts: 356
Thanks: 143
Thanked 0 Times in 0 Posts
ptrcao is an unknown quantity at this point
Quote:
Originally Posted by Fou-Lu View Post
This sounds like a webserver configuration problem to me, not a PHP one. Have you checked with your host on configurations (or reviewed your own if you host)?
I don't know what to look for. Except I have a hunch .htaccess may be relevant.

Quote:
Originally Posted by Fou-Lu View Post
Is the subdomain a part of your public_html, or is it served outside of it?
I don't know what public_html refers to, but my subdomain is served by the same hosting server as the domain. The directory structure is the typical one.

domain/forums is the directory for my subdomain, so it falls under the domain's directory.

(the subdomain's URL is http://forums.domain.com/.)

Does that answer the question?
__________________
The website I am building is http://www.mathannotated.com. My questions often pertain to it. This is my site plan: http://www.mathannotated.com/images/...ctory-tree.gif
Thank you for your help in all matters. All earnest efforts in helping me will be credited with Thanks. -ptrcao
ptrcao is offline   Reply With Quote
Old 02-17-2011, 01:50 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,644
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Yeah that does. If your domain is served than its a part of public_html (or whatever they have chosen to name it).
It could be an .htaccess issue for sure. Check your domain level htaccess to see if it does things like addtype in it or anything with .php or x-httpd-php. Also check if there is a PHPINIDir in there if you are running as a cgi.
If the subdirectory overrides some of these directives, than the PHP will not parse. Pathing is the only thing that could be an issue (such as the PHPIniDir if its pointing at the wrong spot) with this, since if your subdirectory restates the addtype directives than the override is just the same as the parent.

Sounds to me like you are going to get in touch with your host. I assumed your subdomain is actually show the PHP code when you access the page is that right?
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Old 02-17-2011, 04:02 PM   PM User | #5
ptrcao
Regular Coder

 
Join Date: Dec 2010
Location: Australia
Posts: 356
Thanks: 143
Thanked 0 Times in 0 Posts
ptrcao is an unknown quantity at this point
Quote:
Originally Posted by Fou-Lu View Post
Yeah that does. If your domain is served than its a part of public_html (or whatever they have chosen to name it).
It could be an .htaccess issue for sure. Check your domain level htaccess to see if it does things like addtype in it or anything with .php or x-httpd-php. Also check if there is a PHPINIDir in there if you are running as a cgi.
If the subdirectory overrides some of these directives, than the PHP will not parse. Pathing is the only thing that could be an issue (such as the PHPIniDir if its pointing at the wrong spot) with this, since if your subdirectory restates the addtype directives than the override is just the same as the parent.

Sounds to me like you are going to get in touch with your host. I assumed your subdomain is actually show the PHP code when you access the page is that right?
Yep, exactly - PHP code was showing up instead of being executed.

I mean since my subdomain is a subdirectory, I assumed the .htaccess at the higher level would apply to it as well. Is there a command to specifically enable (and disable) PHP-parsing for subdirectories in my master .htaccess file?
__________________
The website I am building is http://www.mathannotated.com. My questions often pertain to it. This is my site plan: http://www.mathannotated.com/images/...ctory-tree.gif
Thank you for your help in all matters. All earnest efforts in helping me will be credited with Thanks. -ptrcao
ptrcao is offline   Reply With Quote
Old 02-17-2011, 04:30 PM   PM User | #6
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,644
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Quote:
Originally Posted by ptrcao View Post
Yep, exactly - PHP code was showing up instead of being executed.

I mean since my subdomain is a subdirectory, I assumed the .htaccess at the higher level would apply to it as well. Is there a command to specifically enable (and disable) PHP-parsing for subdirectories in my master .htaccess file?
That would be my assumption as well, but I'm afraid I'm not much of an apache wizard myself; my understanding is that .htaccess cascades through subdirectories, but perhaps this just isn't the case with subdomains (you can control enable/disable with the use of the addtype and I think its removetype directives, but I'm not sure if .htaccess allows directory level control of its subdirectories [I kinda think so], but I wouldn't do that myself - I'd add a .htaccess into the subdirectory which will unlink the relationship between the parent to the child directories).

With the edit in your OP, does that mean you've gotten this resolved? Also, I'll move this to the apache configurations forum, since it really doesn't have anything to do with PHP.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Old 02-17-2011, 04:38 PM   PM User | #7
ptrcao
Regular Coder

 
Join Date: Dec 2010
Location: Australia
Posts: 356
Thanks: 143
Thanked 0 Times in 0 Posts
ptrcao is an unknown quantity at this point
Quote:
Originally Posted by Fou-Lu View Post
That would be my assumption as well, but I'm afraid I'm not much of an apache wizard myself; my understanding is that .htaccess cascades through subdirectories, but perhaps this just isn't the case with subdomains (you can control enable/disable with the use of the addtype and I think its removetype directives, but I'm not sure if .htaccess allows directory level control of its subdirectories [I kinda think so], but I wouldn't do that myself - I'd add a .htaccess into the subdirectory which will unlink the relationship between the parent to the child directories).

With the edit in your OP, does that mean you've gotten this resolved? Also, I'll move this to the apache configurations forum, since it really doesn't have anything to do with PHP.
Yes, I have successfully applied .htaccess in the subdomain's directory. But for other longstanding reasons I still want to know how to implement exceptions for subdirectories in my .htaccess file. In fact, weeks ago you were the very person I asked this question (see http://www.codingforums.com/showthre...57#post1041557), but I don't remember that we reached any solution and the original thread remained unresolved. Now that I put it to you again, you mentioned

Quote:
... but I'm not sure if .htaccess allows directory level control of its subdirectories ...[I kinda think so]
Are you any wiser since the last time I put this question to you?

Can anyone help me here?

(PS. Yes, you can relocate the thread if you feel it appropriate.)
__________________
The website I am building is http://www.mathannotated.com. My questions often pertain to it. This is my site plan: http://www.mathannotated.com/images/...ctory-tree.gif
Thank you for your help in all matters. All earnest efforts in helping me will be credited with Thanks. -ptrcao

Last edited by ptrcao; 02-17-2011 at 04:41 PM..
ptrcao is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:53 PM.


Advertisement
Log in to turn off these ads.