New Xampp Security Concept? [SOLVED]

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

New Xampp Security Concept? [SOLVED]

Postby m1k3yb0y » 16. March 2012 21:59

Hey guys! I am new here to this forum. :D Anyway, I am here because I am trying to display a random image on my testing site.
My image files are located in the following:
F:/xampp/htdocs/xampp/justtryinoutsomephp/Images

The reason I put in the "F" instead of "C" is because I am actually using the USB Lite version of xampp. :roll:
Anyway, my images are not displaying because of this new so called "New Xampp Security Concept." I've been doing lots of researching and experimenting for a few days and it came to the point where I just said screw it and post this to the forum.
On the error 403 page, it said:
"Access forbidden!

New XAMPP security concept:

Access to the requested object is only available from the local network.

This setting can be configured in the file 'httpd-xampp.conf'.

If you think this is a server error, please contact the webmaster."

That's what I've been doing is tinkling with the "httpd-xampp.conf" file. On one of the forums, it said that you have to restart the xampp server in order for the changes to take effect. I actually went the simple and easy way and just turned off the server using the xampp off file and turned it back on using the xampp on file as well. Didn't work..... :( So what I am wondering now is is there a way to restart the xampp server without using the xampp off and xampp on files or what adjustments do I need to make in the config file? Thanks for your help and advice guys!
m1k3yb0y
 
Posts: 5
Joined: 16. March 2012 21:46
Operating System: Windows 7 Home Premium x64

Re: New Xampp Security Concept?

Postby Sharley » 16. March 2012 22:13

F:/xampp/htdocs/xampp/justtryinoutsomephp/Images
This is an incorrect location for your files as htdocs/xampp is a protected system folder.

Use instead just the htdocs folder for your own files and folders.
F:/xampp/htdocs/justtryinoutsomephp/Images
http://localhost/justtryinoutsomephp/Images/myimage.jpg

And tinkering with any server configuration file may result in breaking the server unless you first make a backup and second read the comments in these files as they often give clues what the settings are for (Google is also your friend). :)

Best wishes. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: New Xampp Security Concept?

Postby m1k3yb0y » 19. March 2012 21:10

Okay I did what you said and it doesn't do the xampp security concept thing anymore! :D But it still does the 403 forbidden error thing, except it says, "You don't have permission to access the requested object. It is either read-protected or not readable by the server."
m1k3yb0y
 
Posts: 5
Joined: 16. March 2012 21:46
Operating System: Windows 7 Home Premium x64

Re: New Xampp Security Concept?

Postby Sharley » 20. March 2012 02:08

1. Paste here exactly what you type in the browser's address bar please.

2. Read the \apache\logs\error.log file for this info about this 403 error and paste here the relevant line (not the whole error.log file).

3. Once again please tell me where the file is located that gives the 403 error in your browser.

4. Did you install XAMPP to the USB device or did you simply move or copy the xampp folder to the USB device from the C:\ drive after installing XAMPP initially to the C:\ drive?

5. Do you intend for this USB device to be portable or to use it as a fixed device?



You could use the version 3 control panel found in the xampp installation folder:
xampp-control-3-beta.exe
Right click on it to select to run as an admin for best results.
Stop all XAMPP components and remove the ticks in the Svc check boxes then click on Exit in the older 2.5 version before starting this version 3 control panel.


Even better, the latest and greatest Control Panel Version 3 download post is linked below my signature.
Simply extract all the files from the CPv3 folder in to the xampp installation folder and overwrite when asked - do not extract the CPv3 folder complete, only extract it's content.
Then right click the xampp-control-3-beta10.exe file to run as administrator and to create a shortcut to the desktop for example, for easier access.

Make sure that you have exited all other control panel versions before starting this latest version.

This version 3 (XCPv3) control panel has many new features including a much more detailed log window and a button to easily access the log files to help with troubleshooting start and running issues.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: New Xampp Security Concept?

Postby m1k3yb0y » 20. March 2012 20:00

Yea I have it on one of my 2GB SD Cards. I believe I originally installed it to my 4GB SanDisk Cruzer USB Flash Drive, but when I got my new laptop a few months ago, I moved it all to the SD Card.

Here is what the log says from the 403 Forbidden error:
[Tue Mar 20 14:50:36 2012] [error] [client 127.0.0.1] (20024)The given path is misformatted or contained invalid characters: Cannot map GET /justtryinoutsomephp/%3Cbr%20/%3E%3Cb%3ENotice%3C/b%3E:%20%20Undefined%20variable:%20selectImage%20in%20%3Cb%3EF:/xampp/htdocs/justtryinoutsomephp/Home.php%3C/b%3E%20on%20line%20%3Cb%3E8%3C/b%3E%3Cbr%20/%3E HTTP/1.1 to file, referer: http://127.0.0.1/justtryinoutsomephp/Home.php

I'll give Xampp Control Panel V3 Beta some thought.
m1k3yb0y
 
Posts: 5
Joined: 16. March 2012 21:46
Operating System: Windows 7 Home Premium x64

Re: New Xampp Security Concept?

Postby Altrea » 20. March 2012 22:35

Hi m1k3yb0y,

read the php notice inside your GET url.
m1k3yb0y wrote:GET /justtryinoutsomephp/%3Cbr%20/%3E%3Cb%3ENotice%3C/b%3E:%20%20Undefined%20variable:%20selectImage%20in%20%3Cb%3EF:/xampp/htdocs/justtryinoutsomephp/Home.php%3C/b%3E%20on%20line


so look into your /xampp/htdocs/justtryinoutsomephp/Home.php file on line 20 whats going on.
We don't know your code, so you are the only person who can debug this error.
We can't know, why he is searching for a $selectImage variable at this postion.

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: 8299
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: New Xampp Security Concept?

Postby m1k3yb0y » 22. March 2012 21:26

For the heck of it. Only 18 lines.

Code: Select all
<html>
<body>
<?php include 'F:/xampp/htdocs/justtryinoutsomephp/header.inc.php';
include 'F:/xampp/htdocs/justtryinoutsomephp/menu.inc.php';
include 'F:/xampp/htdocs/justtryinoutsomephp/ImageTest.php';?>
<div id="wrapper">
  <div id="pictureWrapper">
    <img src="<?php echo $selectImage;?>" alt="Random image"
      class="picBorder">
  </div>
    <div id="maincontent">
      <h2>Welcome to the home of the Mikester on the web!</h2>
      <p>Coming soon.</p>
    </div>
</div>
<?php include 'F:/xampp/htdocs/justtryinoutsomephp/footer.inc.php';?>
</body>
</html>
m1k3yb0y
 
Posts: 5
Joined: 16. March 2012 21:46
Operating System: Windows 7 Home Premium x64

Re: New Xampp Security Concept?

Postby Altrea » 22. March 2012 22:15

sorry, i misread the message, it is url encoded.
The correct line number is 8

Code: Select all
<img src="<?php echo $selectImage;?>" alt="Random image"


$selectImage doesn't exist in every case.
And nobody can know when it will be setted.

Mayby your code is depended on the very old and unrecommend php setting register_globals.

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: 8299
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: New Xampp Security Concept?

Postby m1k3yb0y » 27. March 2012 17:54

Hey guys. I finally got it working! For my images to randomly show up,
I was originally using the full location URL thing like this:
F:/xampp/htdocs/justtryinoutsomephp/Images/Pic1.jpg

Now I have it set up like this:
/Images/Pic1.jpg

Thanks for the help guys! :D
m1k3yb0y
 
Posts: 5
Joined: 16. March 2012 21:46
Operating System: Windows 7 Home Premium x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 30 guests