Page 1 of 1

Where should I put my practice PHP files?

PostPosted: 21. January 2008 04:42
by rusloc
I installed XAMPP to facilitate my learning of PHP.
I guess I must save my php files to a user directory in http://localhost/, but don't know how to do it. What should I do to create a folder which will be visible from a browser?

Detailed instructions will be appreciated. If this is FAQ - point me to an answer please. TIA

PostPosted: 21. January 2008 07:59
by skuipers
All user written html and php files should go into /opt/lampp/htdocs. So create a new folder, f.i. /opt/lampp/htdocs/php and put all your learning files in this folder and subfolders.

You should now be able to access your php files in the browser: f.i. http://your_url/php/practise.php

(Note that php must be enabled in httpd.conf in order to run php files. It probably already is, but you can check this on http://your_url/xampp/status.php)

PostPosted: 21. January 2008 22:06
by rusloc
skuipers wrote:create a new folder, f.i. /opt/lampp/htdocs/php and put all your learning files in this folder and subfolders.

You should now be able to access your php files in the browser: f.i. http://your_url/php/practise.php
Thanks for your help.
I did as you suggested, but I cannot save a test file to that folder.
Image

What should I do?

PostPosted: 21. January 2008 22:15
by Scory
>What should I do?

Simply follow the error message:

"Check that you have write access to this file".

PostPosted: 21. January 2008 22:26
by rusloc
Scory wrote:>What should I do?

Simply follow the error message:

"Check that you have write access to this file".
I feel that I need to change permissions not only to the folder that I created, but to the parent as well... but I don't remember how / where to do it...
Folks, I forgot to mention, that I am VERY new to Linux, and I am very old (61 years, poor memory as you may guess).

I'll appreciate it if you tell me HOW I could check it? I just started learning the terminal commands, and even finding things on my computer is a challenge.

Let's say, I am in KDE (openSUSE), where should I begin?
TIA

PostPosted: 21. January 2008 23:56
by rusloc
Scory wrote:"Check that you have write access to this file".
Why don't I have write access to it? I myself created it and try to save it. Puzzling.

I just had a thought: maybe I should have installed XAMPP not as "root", but as a normal user?

PostPosted: 23. January 2008 22:43
by rusloc
The answer was pretty simple, I was helped in another forum:
From the CLI as root:

chown -R rusloc:users /opt/lampp/htdocs/testfolder

Assuming your login is rusloc

It worked!