Alias and php.ini problems

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Alias and php.ini problems

Postby said_fox » 26. July 2006 23:22

Hello,
This is the first time in which I use XAMPP. I have two problems:
1) The Alias for any directory on my system could not be accessible. i.e the server returns Error 403. I make this from the httpd.conf. So, how can I make accessible web folder?
2) I noticed that the server gets the php configurations from another php.ini file. The ini file it gets, I was placed it into the folder of Apache 1.3 which I already had installed it before. When I change the extension of that php.ini, XAMPP's server gets its php.ini and no problems. So, why XAMPP's server neglects the php.ini inside its root folder?
Best->Regards()
Said<-Bakr
User avatar
said_fox
 
Posts: 11
Joined: 26. July 2006 23:00
Location: Egypt
Operating System: Ubuntu 11.10

Postby Izzy » 26. July 2006 23:38

1) The Alias for any directory on my system could not be accessible. i.e the server returns Error 403. I make this from the httpd.conf. So, how can I make accessible web folder?

Please provide more info. Copy and paste the changes you made so we can see why this is happening.
2) I noticed that the server gets the php configurations from another php.ini file. The ini file it gets, I was placed it into the folder of Apache 1.3 which I already had installed it before. When I change the extension of that php.ini, XAMPP's server gets its php.ini and no problems. So, why XAMPP's server neglects the php.ini inside its root folder?

Apache reads the php.ini file in xampp\apache\bin\php.ini and it is not advisable to change this in any way. You can however edit and change the configurations within this file. Just make sure you make a backup of the original php.ini and the httpd.conf files before you make any changes. This will allow you to revert back if the server gives you an error message.

Also are you saying you have more than 1 version of XAMPP Apache running?
XAMPP 1.5.3a uses Apache 2+
You mention Apache 1.3?
More than 1 version running at once will only cause you enormous problems. Remove any other versions than the latest XAMPP 1.5.3a using a clean install as recommended. This might help solve any confussion between versions, paths and just general overall smooth operation.

Always try and give us full error information including any changes you have made from your original configuration files. Like this:
original configuration I changed it to this changed configuration.
It helps us to help you quickly.
Thanks. :)
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby said_fox » 27. July 2006 00:15

Hello,
I just have only one working XAMPP version working on my computer. It's the latest version XAMPP 1.5.3a .
Other Apaches servers that I had talken about, don't belongs to XAMPP. They were installed on C:\Program Files\Apache Group\. Indeed, I have two servers of Apache in the previous path regarede, Apache 1.3.27 (PHP 4.3.5) and Apache 2.0.xx (PHP 5.0.x),. As I think they should not has any relation with the Apache server of XAMPP.
By the way I installed XAMPP in E:\programs\.
The first time I run the Apache server of XAMPP I noticed from the phpinfo() that it gets its configuration from C:\program files\apache group\apache\php.ini
What I did is changing the php.ini file's name in the regarded path to php.in_. After that I restarted the server of XAMPP and it works fine by getting the php.ini of XAMPP.
I tried to make an alias
Alias /tphp "F:/test_/"
When I try access http://localhost/tphp/anypage.anytype the server returns Forbidden Access 403 error page.
Best->Regards()
Said<-Bakr
User avatar
said_fox
 
Posts: 11
Joined: 26. July 2006 23:00
Location: Egypt
Operating System: Ubuntu 11.10

Postby Izzy » 27. July 2006 00:40

You may also need to have a <directory></directory> section to allow you access to the F:/test_/ directory:

Code: Select all
#
    # Alias: Maps web paths into filesystem paths and is used to
    # access content that does not live under the DocumentRoot.
    # Example:
    # Alias /webpath /full/filesystem/path
    #
    # If you include a trailing / on /webpath then the server will
    # require it to be present in the URL.  You will also likely
    # need to provide a <Directory> section to allow access to
    # the filesystem path.


<IfModule alias_module>
Alias /tphp "F:/test_/"
</IfModule>

<Directory "F:/test_/">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>


Experiment with the above and read the commented lines # in the xampp/apache/conf/httpd.conf as they always give you some very useful clues if you get error messages.

A 403 error is an access permission error and the above commented lines explain that you need to set a <directory></directory> permission section to allow or deny access.

Access is denied by default in the httpd.conf file so you have to change that behavior if you don't want a 403 error.
Code: Select all
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features. 
#
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>
But don't change this default setting though. Just set a <directory></directory> section for the directory you want to change permissions for. As in my first example above.

So, why XAMPP's server neglects the php.ini inside its root folder?
Xampp's Apache is using the Windows Registry first.
If it finds another php.ini file location in the registry then it assumes you have another php installation somewhere you want to use (which you had). This is perfectly normal proceedure.
You changed the php.ini file extension on the one you don't want to use so XAMPP Apache could not locate the one in the Windows Registry and so it used it's own default php.ini file, which is all it knows how to do and again this is perfectly normal.

HTH and good luck :)
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby said_fox » 27. July 2006 10:33

Thank you,
I could able to publish the file system folder test_ as tphp.
There is a little question about the ASP using perl. I have installed the perl add-on to XAMPP. The ASP using perl example work fine inside xampp/htdocs/modperlasp/. Now, I want the ASP example to works in the test_ folder which we published it as tphp. How could I do this? Or in general I want the server deals with any file of .asp extension as ASP using perl script, what ever its location on the server.
Best->Regards()
Said<-Bakr
User avatar
said_fox
 
Posts: 11
Joined: 26. July 2006 23:00
Location: Egypt
Operating System: Ubuntu 11.10


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 127 guests