How can I run a page? [Solved]

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

How can I run a page? [Solved]

Postby mendy » 10. October 2012 02:02

How can I run a simple html page with some php?

I already have the page and everything. Where can I find it?
mendy
 
Posts: 2
Joined: 10. October 2012 02:01
Operating System: Linux-Linux mint 13

Re: How can I run a page?

Postby JonB » 10. October 2012 03:02

User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: How can I run a page?

Postby mendy » 10. October 2012 03:13

Yeah so I set up a puplic_html and everything. I have my page, But the PHP doesn't show. I have <?PHP echo 'test' ?> Nothing shows?
mendy
 
Posts: 2
Joined: 10. October 2012 02:01
Operating System: Linux-Linux mint 13

Re: How can I run a page?

Postby Altrea » 10. October 2012 15:53

What did you type in your browsers address bar and where is the file saved?
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: How can I run a page?

Postby PaulRuth2009 » 16. November 2012 20:37

Jumping in as I have the same question.
Saved the frontpage.html file in /opt/lampp/web and typed http://localhost/opt/lampp/web/frontpage.html into the browser.
The error I get is:
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
Apache/2.4.3 (Unix) OpenSSL/1.0.1c PHP/5.4.7

Help!
PaulRuth2009
 
Posts: 3
Joined: 16. November 2012 20:23
Operating System: Bodhi Linux

Re: How can I run a page?

Postby JonB » 18. November 2012 15:56

Probably because you should be putting the files under 'htdocs', unless you created an Alias or changed the DocumentRoot in httpd.conf

Good Luck
:)


ysf
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: How can I run a page?

Postby PaulRuth2009 » 19. November 2012 20:16

I double-checked the httpd.conf file, and /opt/lampp/htdocs is the DocumentRoot. I moved the files I'm trying to run over to that directory as well. Still no luck.
Thanks for your help,
Ruth
PaulRuth2009
 
Posts: 3
Joined: 16. November 2012 20:23
Operating System: Bodhi Linux

Re: How can I run a page?

Postby JonB » 19. November 2012 23:20

A. what are the exact filenames and URL's you are using?

B: Did you change the ownership of the files to nobody:root? (as root via su or sudo)
chown -R nobody:root /opt/lampp/htdocs/your_folder_name

C: Are you still getting a 404 after you change the ownership?

:shock:
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: How can I run a page?

Postby Nobbie » 19. November 2012 23:57

PaulRuth2009 wrote:Saved the frontpage.html file in /opt/lampp/web and typed http://localhost/opt/lampp/web/frontpage.html into the browser.


A "DocumentRoot" means, that this directory on your local PC is the Root Directory / from the view of your Apache server. That means, all documents in /opt/xampp/htdocs/ are mapped to the root of Apache, what results in http://localhost/ (and nothing more!).

If you have a file in your DocumentRoot like test.html, the full path on your local PC is /opt/lampp/htdocs/test.html - but from the view of Apache it is http://localhost/test.html

Finally, if you enter http://localhost/opt/lampp/htdocs/test.html, this yields to the local path /opt/lampp/htdocs/opt/lampp/htdocs/test.html - what is nonsense as you easily can see. That is the idea of having a DocumentRoot, that you do not have to enter the full local path, as the root already yields to /opt/lampp/htdocs
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: How can I run a page?

Postby PaulRuth2009 » 25. November 2012 03:48

Success!
Thank you thank you thank you...
Now I can get back to working on my final project...
Ruth
:D
PaulRuth2009
 
Posts: 3
Joined: 16. November 2012 20:23
Operating System: Bodhi Linux


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 11 guests