XAMPP Install Error

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

XAMPP Install Error

Postby nexus101 » 13. January 2014 03:47

Hello everyone and already thanks for your support . I am new to php, and I have had some problems with the installation. Obviously before you ask , I have revised post, so I hope not to be redundant.

While the situation is that I installed xampp , apache server and mysql are running but when I try to run the default index.php file :

================================================== ==========
<? php
if ( empty ($ _SERVER [' HTTPS '] ) && ( 'on' == $ _SERVER [' HTTPS '] ) ) {
$ uri = ' https:// ';
Else { }
$ uri = ' http://' ;
}
$ uri = $ _SERVER [' HTTP_HOST '] . ;
header ( 'Location : ' . . $ uri '/ xampp / ');
exit;
>
Something is wrong with the XAMPP installation :-(
================================================== ==========



Shows me the following message in the browser :

================================================== ===========
"Object not found!

The requested URL was not found on this server . If You entered the URL manually Please check your spelling and try again.

If you think this is a server error , please contact the webmaster.
Error 404
localhost
==================================================

I do this by putting in the browser: http://localhost/xampp/htdocs/index.php .

On the other hand if I open the same file and run from netbeans shows me the following message:

=================================================
file :/ / / C :/ Users/Nexus/AppData/Local/Temp/index.php5734407163682923972.html
=================================================

Notice: Undefined index: HTTP_HOST in C : \ xampp \ htdocs \ index.php on line 7 Warning : Can not modify header information - headers already sent by (output started at C : \ xampp \ htdocs \ index.php : 7) in C : \ xampp \ htdocs \ index.php on line 8
==================================================

The funny thing is that if I run another php file from netbeans , it does well , but if I run that same file from notepad + + shows the same error: "Object not found ! ...

Well I hope someone can give me some clue from already thank you very much !
nexus101
 
Posts: 4
Joined: 13. January 2014 03:16
Operating System: windows 7

Re: XAMPP Install Error

Postby Altrea » 13. January 2014 07:31

Hi nexus101,

nexus101 wrote:I do this by putting in the browser: http://localhost/xampp/htdocs/index.php .

Which is the wrong url.
\xampp\htdocs\index.php will be requested by URL http://localhost/index.php

nexus101 wrote:On the other hand if I open the same file and run from netbeans shows me the following message:

=================================================
file :/ / / C :/ Users/Nexus/AppData/Local/Temp/index.php5734407163682923972.html
=================================================

We can't see files that are locally saved to your very own computer.

nexus101 wrote:Notice: Undefined index: HTTP_HOST in C : \ xampp \ htdocs \ index.php on line 7
Warning : Can not modify header information - headers already sent by (output started at C : \ xampp \ htdocs \ index.php : 7) in C : \ xampp \ htdocs \ index.php on line 8

The warning is an aftereffect of the notice.
$_SERVER['HTTP_HOST'] can be empty, which is maybe the case with Netbeans.

nexus101 wrote:The funny thing is that if I run another php file from netbeans , it does well , but if I run that same file from notepad + + shows the same error: "Object not found ! ...

Difficult to say. I don't know how you request a page from Notepad++ and which settings this editor uses.

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: XAMPP Install Error

Postby nexus101 » 14. January 2014 05:41

Altrea wrote:Hi nexus101,


nexus101 wrote:I do this by putting in the browser: http://localhost/xampp/htdocs/index.php .

Which is the wrong url.
\xampp\htdocs\index.php will be requested by URL http://localhost/index.php


first of all, thank you very much for your answers and for your time, really appreciate it

I think maybe you did not understand my question well. I understand XAMPP has a default file called "index.php" in a subfolder htdocs in, which once installation is complete, making double click on it can display two messages: "it works" if everything works well, or else like: "Something is wrong with the XAMPP installation :-(" which serves to know if it works well or not
The link you mention: http://localhost/xampp/ brings me to the XAMPP screen like this: http://www.summarg.com/wp-content/uploads/2011/08/xampp2.jpg


Altrea wrote:
nexus101 wrote:On the other hand if I open the same file and run from netbeans shows me the following message:


=================================================
file :/ / / C :/ Users/Nexus/AppData/Local/Temp/index.php5734407163682923972.html
=================================================

We can't see files that are locally saved to your very own computer.

nexus101 wrote:Notice: Undefined index: HTTP_HOST in C : \ xampp \ htdocs \ index.php on line 7
Warning : Can not modify header information - headers already sent by (output started at C : \ xampp \ htdocs \ index.php : 7) in C : \ xampp \ htdocs \ index.php on line 8

The warning is an aftereffect of the notice.
$_SERVER['HTTP_HOST'] can be empty, which is maybe the case with Netbeans.


In this case it does not work, but I was able to run php files from netbeans. You can choose which browser will display the results, or even the intern who has netbeans

Altrea wrote:
nexus101 wrote:The funny thing is that if I run another php file from netbeans , it does well , but if I run that same file from notepad + + shows the same error: "Object not found ! ...

Difficult to say. I don't know how you request a page from Notepad++ and which settings this editor uses.

best wishes,
Altrea


'm a newbies, but it's easy to run a file from notepad + +, simply choose from the menu, launch from firefox / IE / Chrome / Safari the only downside is that it will run "file :/ / / C :/ xampp/htdocs/PhpProject1 / index.php "instead of localhost, so obviously not display anything.

Thank you very much for everything, and if anyone has any ideas to solve the aforementioned error message, will be attentive to your suggestions
nexus101
 
Posts: 4
Joined: 13. January 2014 03:16
Operating System: windows 7

Re: XAMPP Install Error

Postby Altrea » 14. January 2014 18:30

nexus101 wrote:first of all, thank you very much for your answers and for your time, really appreciate it

You are welcome :)

nexus101 wrote:I think maybe you did not understand my question well.

No, i believe i have understand your question but you don't understand my answer.
I will try to explain related to your response.

nexus101 wrote:I understand XAMPP has a default file called "index.php" in a subfolder htdocs

correct

nexus101 wrote:in, which once installation is complete, making double click on it can display two messages: "it works" if everything works well, or else like: "Something is wrong with the XAMPP installation :-(" which serves to know if it works well or not

No. The answer is a check if php is parsed correctly or not, that is correct.
But you can't double-click or start the file with your text editor. PHP is a serverside programming language so the file needs to be parsed by an php interpreter first (which your browser or notepad++ text-editor don't know - PHP IDEs like Netbeans have configurations to set which url needs to be requested)

nexus101 wrote:The link you mention: http://localhost/xampp/ brings me to the XAMPP screen like this: http://www.summarg.com/wp-content/uploa ... xampp2.jpg

Which is the expected result.
The file \xampp\htdocs\index.php redirects to that page on success, and on failure print the message "Something is wrong with the XAMPP installation :-(".
You will not get any "It works" message on success.

nexus101 wrote:I'm a newbies, but it's easy to run a file from notepad + +, simply choose from the menu, launch from firefox / IE / Chrome / Safari the only downside is that it will run "file :/ / / C :/ xampp/htdocs/PhpProject1 / index.php "instead of localhost, so obviously not display anything.

Any file:// file operations from your browser are provided by your filesystem, not your webserver or parser. Your browser has the functionality to read any ASCII based files and print them out if they contain any html. Try it out yourself! Create any html content and save the file as test.abc. Your browser will read it and will even display your html. But that doesn't have anything to do with XAMPP or PHP.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: XAMPP Install Error

Postby Altrea » 14. January 2014 18:30

nexus101 wrote:first of all, thank you very much for your answers and for your time, really appreciate it

You are welcome :)

nexus101 wrote:I think maybe you did not understand my question well.

No, i believe i have understand your question but you don't understand my answer.
I will try to explain related to your response.

nexus101 wrote:I understand XAMPP has a default file called "index.php" in a subfolder htdocs

correct

nexus101 wrote:in, which once installation is complete, making double click on it can display two messages: "it works" if everything works well, or else like: "Something is wrong with the XAMPP installation :-(" which serves to know if it works well or not

No. The answer is a check if php is parsed correctly or not, that is correct.
But you can't double-click or start the file with your text editor. PHP is a serverside programming language so the file needs to be parsed by an php interpreter first (which your browser or notepad++ text-editor don't know - PHP IDEs like Netbeans have configurations to set which url needs to be requested)

nexus101 wrote:The link you mention: http://localhost/xampp/ brings me to the XAMPP screen like this: http://www.summarg.com/wp-content/uploa ... xampp2.jpg

Which is the expected result.
The file \xampp\htdocs\index.php redirects to that page on success, and on failure print the message "Something is wrong with the XAMPP installation :-(".
You will not get any "It works" message on success.

nexus101 wrote:I'm a newbies, but it's easy to run a file from notepad + +, simply choose from the menu, launch from firefox / IE / Chrome / Safari the only downside is that it will run "file :/ / / C :/ xampp/htdocs/PhpProject1 / index.php "instead of localhost, so obviously not display anything.

Any file:// file operations from your browser are provided by your filesystem, not your webserver or parser. Your browser has the functionality to read any ASCII based files and print them out if they contain any html. Try it out yourself! Create any html content and save the file as test.abc. Your browser will read it and will even display your html. But that doesn't have anything to do with XAMPP or PHP.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: XAMPP Install Error

Postby Altrea » 14. January 2014 18:30

nexus101 wrote:first of all, thank you very much for your answers and for your time, really appreciate it

You are welcome :)

nexus101 wrote:I think maybe you did not understand my question well.

No, i believe i have understand your question but you don't understand my answer.
I will try to explain related to your response.

nexus101 wrote:I understand XAMPP has a default file called "index.php" in a subfolder htdocs

correct

nexus101 wrote:in, which once installation is complete, making double click on it can display two messages: "it works" if everything works well, or else like: "Something is wrong with the XAMPP installation :-(" which serves to know if it works well or not

No. It is a check if php is parsed correctly or not, that is correct.
But you can't double-click or start the file with your text editor. PHP is a serverside programming language so the file needs to be parsed by an php interpreter first (which your browser or notepad++ text-editor don't know - PHP IDEs like Netbeans have configurations to set which url needs to be requested)

nexus101 wrote:The link you mention: http://localhost/xampp/ brings me to the XAMPP screen like this: http://www.summarg.com/wp-content/uploa ... xampp2.jpg

Which is the expected result.
The file \xampp\htdocs\index.php redirects to that page on success, and on failure print the message "Something is wrong with the XAMPP installation :-(".
You will not get any "It works" message on success.

nexus101 wrote:I'm a newbies, but it's easy to run a file from notepad + +, simply choose from the menu, launch from firefox / IE / Chrome / Safari the only downside is that it will run "file :/ / / C :/ xampp/htdocs/PhpProject1 / index.php "instead of localhost, so obviously not display anything.

Any file:// file operations from your browser are provided by your filesystem, not your webserver or parser. Your browser has the functionality to read any ASCII based files and print them out if they contain any html. Try it out yourself! Create any html content and save the file as test.abc. Your browser will read it and will even display your html. But that doesn't have anything to do with XAMPP or PHP.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: XAMPP Install Error

Postby nexus101 » 14. January 2014 21:39

Altrea wrote:
Altrea wrote:
nexus101 wrote:first of all, thank you very much for your answers and for your time, really appreciate it

You are welcome :)

nexus101 wrote:I think maybe you did not understand my question well.

No, i believe i have understand your question but you don't understand my answer.
I will try to explain related to your response.



Thank you very much again! and I owe you an apology , it was I who did not quite understand the answer.
Altrea wrote:
nexus101 wrote:I understand XAMPP has a default file called "index.php" in a subfolder htdocs

correct

nexus101 wrote:in, which once installation is complete, making double click on it can display two messages: "it works" if everything works well, or else like: "Something is wrong with the XAMPP installation :-(" which serves to know if it works well or not

No. It is a check if php is parsed correctly or not, that is correct.
But you can't double-click or start the file with your text editor. PHP is a serverside programming language so the file needs to be parsed by an php interpreter first (which your browser or notepad++ text-editor don't know - PHP IDEs like Netbeans have configurations to set which url needs to be requested)


Better explained impossible ;-)

Altrea wrote:
nexus101 wrote:The link you mention: http://localhost/xampp/ brings me to the XAMPP screen like this: http://www.summarg.com/wp-content/uploads/2011/08/xampp2.jpg

Which is the expected result.
The file \xampp\htdocs\index.php redirects to that page on success, and on failure print the message "Something is wrong with the XAMPP installation :-(".
You will not get any "It works" message on success.


You're right again, to see the code of the file " index.php " you obviously can not show "it works" . The file itself is index.HTML do that , but that does not think it has anything to do with that php is working properly or not, does it?

Altrea wrote:
nexus101 wrote:I'm a newbies, but it's easy to run a file from notepad + +, simply choose from the menu, launch from firefox / IE / Chrome / Safari the only downside is that it will run "file :/ / / C :/ xampp/htdocs/PhpProject1 / index.php "instead of localhost, so obviously not display anything.

Any file:// file operations from your browser are provided by your filesystem, not your webserver or parser. Your browser has the functionality to read any ASCII based files and print them out if they contain any html. Try it out yourself! Create any html content and save the file as test.abc. Your browser will read it and will even display your html. But that doesn't have anything to do with XAMPP or PHP.


very interesting, did not know that

with everything you've told me , I could solve the problem.

For the above XAMPP is installed correctly, then display the message : "Something is wrong with the XAMPP installation :-( " when I open it directly , instead of putting the right direction that is " http://localhost/xampp/index . php "in the browser (no need to specify index.php )

Furthermore when I open a file in the broser putting " http://localhost/xampp/htdocs/PhpProject1/while.php " and shows me the error message: "Object not found ...... It is Precisely Because finds nothing in That direction , does not exist , Because the correct address is " http://localhost/PhpProject1/while.php " that is without Specifying the htdocs folder , it is default .

Many many Thanks again for your explanation , several days ago I was stuck and Could not solve it :D
nexus101
 
Posts: 4
Joined: 13. January 2014 03:16
Operating System: windows 7

Re: XAMPP Install Error

Postby Altrea » 14. January 2014 21:59

nexus101 wrote:The file itself is index.HTML do that , but that does not think it has anything to do with that php is working properly or not, does it?

No, this index.html file is an Apache default file. XAMPP don't use it but it is still present and can be requested by url http://localhost/index.html to check if Apache is working.

nexus101 wrote:Furthermore when I open a file in the broser putting " http://localhost/xampp/htdocs/PhpProject1/while.php " and shows me the error message: "Object not found ...... It is Precisely Because finds nothing in That direction , does not exist , Because the correct address is " http://localhost/PhpProject1/while.php " that is without Specifying the htdocs folder , it is default .

Not only the "htdocs" in the address is wrong, the "xampp" must also be omitted.

The reason for this is that Apache has a root directory (document root). For XAMPP Apache that is \xampp\htdocs\. Commonly the request url is based on that document root.
document root is configurated by setting DocumentRoot in \xampp\apache\conf\httpd.conf.
You can change it to something else like \xampp\htdocs\PhpProject1\, maybe that will give a little more inside how this setting works.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: XAMPP Install Error

Postby nexus101 » 14. January 2014 22:53

Altrea wrote:
nexus101 wrote:The file itself is index.HTML do that , but that does not think it has anything to do with that php is working properly or not, does it?

No, this index.html file is an Apache default file. XAMPP don't use it but it is still present and can be requested by url http://localhost/index.html to check if Apache is working.


Ok, I understood

Altrea wrote:Not only the "htdocs" in the address is wrong, the "xampp" must also be omitted.


Indeed I did, but I forgot to indicate, thank you very much

Altrea wrote:The reason for this is that Apache has a root directory (document root). For XAMPP Apache that is \xampp\htdocs\. Commonly the request url is based on that document root.
document root is configurated by setting DocumentRoot in \xampp\apache\conf\httpd.conf.
You can change it to something else like \xampp\htdocs\PhpProject1\, maybe that will give a little more inside how this setting works.


Excellent, now I understand much better, thanks for everything!! :D
nexus101
 
Posts: 4
Joined: 13. January 2014 03:16
Operating System: windows 7

Re: XAMPP Install Error

Postby Altrea » 15. January 2014 01:17

You are welcome.
Have fun with XAMPP and all that stuff 8)
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 158 guests