nati Posted September 13, 2008 Share Posted September 13, 2008 Hello everybody! I have a problem with access to my index.php page. If I put an index.html page into my localhost folder and call it from browser, it works fine. But when I put an index.php page into my localhost folder and call it from browser, I'm getting next error: You are not authorized to view this page HTTP Error 403 - Forbidden I cannot find out what caused this problem. Anyone can help? Tnx in advance! Nati Quote Link to comment https://forums.phpfreaks.com/topic/124081-cannot-access-httplocalhostindexphp/ Share on other sites More sharing options...
wildteen88 Posted September 13, 2008 Share Posted September 13, 2008 How do you currently have Apache configured? You most probably have something misconfigured. Quote Link to comment https://forums.phpfreaks.com/topic/124081-cannot-access-httplocalhostindexphp/#findComment-640641 Share on other sites More sharing options...
nati Posted September 14, 2008 Author Share Posted September 14, 2008 Hello! What do you want me exacty to tell you about my Apache configuration? Version is 2.2.8. Tnx, Nati Quote Link to comment https://forums.phpfreaks.com/topic/124081-cannot-access-httplocalhostindexphp/#findComment-641096 Share on other sites More sharing options...
wildteen88 Posted September 14, 2008 Share Posted September 14, 2008 How have you installed PHP? During the process of installing PHP you'll need to configure Apache, in order for it to understand how to handle php files. Quote Link to comment https://forums.phpfreaks.com/topic/124081-cannot-access-httplocalhostindexphp/#findComment-641101 Share on other sites More sharing options...
nati Posted September 14, 2008 Author Share Posted September 14, 2008 Hi, Here is code I put into Apache httpd file: ScriptAlias /php/ "c:/php/" AddType application/x-httpd-php .php .phtml Action application/x-httpd-php "/php/php.exe" Regards, Nati Quote Link to comment https://forums.phpfreaks.com/topic/124081-cannot-access-httplocalhostindexphp/#findComment-641108 Share on other sites More sharing options...
wildteen88 Posted September 14, 2008 Share Posted September 14, 2008 I never recommend to setup PHP in CGI mode. I always configure PHP as an Apache Module using the following instead: LoadModule php5_module "C:/php/php5apache2_2.dll" PHPIniDir "C:/php" AddType application/x-httpd-php .php Quote Link to comment https://forums.phpfreaks.com/topic/124081-cannot-access-httplocalhostindexphp/#findComment-641113 Share on other sites More sharing options...
nati Posted September 14, 2008 Author Share Posted September 14, 2008 Hi, Tnx a lot, it is better now, but there is still a small problem. When I call http://localhost/index.php, I'm getting my php page correctly. But when I call http://localhost, I'm just getting the content of my localhost folder including a link to index.php. As I know, I should get index.whatever page as a default page by calling http://localhost, right? I suppose it is different problem now... ??? Regards, Nati Quote Link to comment https://forums.phpfreaks.com/topic/124081-cannot-access-httplocalhostindexphp/#findComment-641120 Share on other sites More sharing options...
wildteen88 Posted September 14, 2008 Share Posted September 14, 2008 Add index.php to the DirectoryIndex directive in Apaches httpd.conf Quote Link to comment https://forums.phpfreaks.com/topic/124081-cannot-access-httplocalhostindexphp/#findComment-641124 Share on other sites More sharing options...
nati Posted September 14, 2008 Author Share Posted September 14, 2008 THANKS!!! It works now correctly! Regards, Nati Quote Link to comment https://forums.phpfreaks.com/topic/124081-cannot-access-httplocalhostindexphp/#findComment-641162 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.