LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-19-2004, 04:49 PM   #1
ClarkNG
LQ Newbie
 
Registered: Aug 2004
Distribution: SuSE 9.1 Personal
Posts: 25

Rep: Reputation: 15
Running a php script locally on SuSE 9.1 Personal


Greetings,

One thing I'd like to do is run my pHp scripts locally, from my hard drive. I wasn't able to do this on Windows XP, and I've heard some people talking about how easy it is on Linux. Is this possible? It would help a lot to be able to test my scripts before uploading them to the web. Is there some sort of progam I need to download? Is it a command I enter into the shell?

Thanks,
 
Old 08-19-2004, 08:17 PM   #2
Boby
Member
 
Registered: Feb 2004
Location: Sighisoara/Cluj-Napoca (Romania)
Distribution: CentOS 4, Fedora Core 6
Posts: 781

Rep: Reputation: 32
Hello!

EDIT: Welcome to LQ!

Ok, first you need a webserver, best you download and install the "apache webserver" [www.httpd.apache.org] from here .
It's very easy, you'll get a documentation with the package.

Then you'll need PHP [www.php.net], download it from here . Documentation is also included.

Optionally you can download MySQL [www.mysql.com] from here .

You can find on this forum a lot of info about Apache+PHP+MySQL.

Hope this helped!
Boby

PS: I think Suse comes with these packages installed, or you can select them in the insllation options.
 
Old 08-19-2004, 11:32 PM   #3
Mikhail_16
Member
 
Registered: Oct 2003
Distribution: Gentoo rules them all
Posts: 279

Rep: Reputation: 31
Alternatively you can use LAMPP http://www.apachefriends.org/en/xampp-linux.html if you are not sure how to install all that stuff mentioned above. Although it should be pretty simple to start up apache; try this:
Command prompt (#):
#sudo su - (change to root)
#/etc/init.d/apache (or httpd) start

if the status sais ok try opening up your browser and typing in :
http://localhost

if you see something other than "unable to locate page" you are fairly well set, and all you need to do is put your php scripts for testing into /var/www/localhost/htdocs and run them by using url like this http://localhost/[your php scrpt].php . good luck.
 
Old 08-20-2004, 12:34 PM   #4
ClarkNG
LQ Newbie
 
Registered: Aug 2004
Distribution: SuSE 9.1 Personal
Posts: 25

Original Poster
Rep: Reputation: 15
Thanks a lot!
I am now running xampp with php and mysql, however, I cant find the directory /var/www/localhost/htdocs/. I DID find something else that looked convincing: /srv/www/htdocs, but when i try to write in it, it says "access denied, unable to write to /srv/www/htdocs/." What do i do?

Last edited by ClarkNG; 08-20-2004 at 12:35 PM.
 
Old 08-20-2004, 01:17 PM   #5
Mikhail_16
Member
 
Registered: Oct 2003
Distribution: Gentoo rules them all
Posts: 279

Rep: Reputation: 31
since you are suing xampp, then your homepage directory will be somewhere under xampp install folder. Try searching for html files under xampp install. also the issue you are having is most likely due to the fact that you are trying to write to a folder with root or apache permissions as a user thus you are not priviledged enough to do so.
 
Old 08-20-2004, 02:55 PM   #6
ClarkNG
LQ Newbie
 
Registered: Aug 2004
Distribution: SuSE 9.1 Personal
Posts: 25

Original Poster
Rep: Reputation: 15
I know. How do I log in as root in the GUI? I can log in through su, but I need to be able to write to that folder.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cron NOT running php script ??!! hendrixx Linux - Software 2 11-15-2006 07:18 AM
gnucash not running with suse 9.1 personal jlp1976 Linux - Software 5 09-23-2004 03:35 AM
Running a windows CD from WINE on a SuSE 9.1 Personal ClarkNG Linux - Software 25 08-25-2004 01:29 PM
Accessing MySQL from a PHP script (locally) lowpro2k3 Linux - Software 2 11-23-2003 09:50 PM
problems running php script rhuser Linux - Software 5 02-14-2003 01:01 PM


All times are GMT -5. The time now is 04:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration