LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-08-2008, 10:38 AM   #1
konqi
Member
 
Registered: Oct 2007
Distribution: Gentoo, Slackware
Posts: 162

Rep: Reputation: 16
"live" version of php?


Is there a way to run php files on your own computer, just like if its on a webserver?
 
Old 02-08-2008, 11:22 AM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Yes... you could use the php-cli interface, or install your own webserver and php instance. (I recommend lighttpd for testing: it's lightweight and easy to use.)
 
Old 02-08-2008, 02:14 PM   #3
konqi
Member
 
Registered: Oct 2007
Distribution: Gentoo, Slackware
Posts: 162

Original Poster
Rep: Reputation: 16
i tried it, but is it possible to parse a html file of the php file (the php file has html code)? Because I want to learn php, but i don't want to upload each little chance in the file to test it
 
Old 02-09-2008, 11:21 PM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
What did you try? Matir's first suggestion or the second?

If you install a webserver on your machine (or on a spare one if you have), you can connect to it using e.g firefox and test.
 
Old 02-10-2008, 02:59 AM   #5
konqi
Member
 
Registered: Oct 2007
Distribution: Gentoo, Slackware
Posts: 162

Original Poster
Rep: Reputation: 16
oh sorry, i forgot to mention that i used the php-cli way.

But i don't want to run a webserver just to test some php-files, but if there isn't an other i should do it that way.
 
Old 02-10-2008, 09:47 AM   #6
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
If you want to display webpages, you need a webserver or you must except the HTML tags in your output.
 
Old 02-10-2008, 10:02 AM   #7
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Quote:
Originally Posted by konqi View Post
But i don't want to run a webserver just to test some php-files, but if there isn't an other i should do it that way.
Well, you usually run a whole lot of different sorts of services "just to surf the web etc.", so I don't see a problem installing a light webserver to ease up your testings, which you can start and stop as needed Apache is an option, but like it was mentioned, there are lighter (and easy-to-use) alternatives around. On Linux deploying a web server is rather easy, and if you intend to use it for your own purposes (like testing your php pages) only, you don't have as big trouble of hardening it security-wise as you would have if you wanted to expose the server to the whole world.

So I'll second the recommendation to install a light web server which is "php-enabled" so you can just create/edit your php files and test the pages in your favourite web browser, without needing to upload anything off your machine before it's ready.
 
Old 02-15-2008, 02:35 PM   #8
konqi
Member
 
Registered: Oct 2007
Distribution: Gentoo, Slackware
Posts: 162

Original Poster
Rep: Reputation: 16
i installed lighttpd and php, but when i start lighttpd with:
Code:
lighttpd -D
it gaves

Code:
2008-02-15 21:29:22: (server.c.548) No configuration available. Try using -f option.
So it misses a configuration file, but where should this file be located. And it it doesn't exist, how can i make one?
 
Old 02-15-2008, 05:01 PM   #9
danboland
Member
 
Registered: Feb 2006
Location: NJ, USA
Distribution: Debian
Posts: 72

Rep: Reputation: 17
If you are just doing development and do not have much experience with setting up a server, i would recommend justs installing xampp from apachefriends.org

It will install Apache, MySQL, and PHP with almost no input needed from you.

There are versions for both linux and windows, and there are also ad on packages for Perl, Tomcat.....



Dan
 
  


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
Where do "Admin" and "User" guides live? Swan1 SUSE / openSUSE 1 07-07-2006 12:53 PM
PHP / VideoLAN / Fedora Core Question - how can I get the PHP "exec" function to work gtrawoger Linux - Software 3 12-21-2005 06:51 AM
Does "ac97 & RH8" imply "buy a Sound Blaster Live"? nicktoop Linux - Hardware 3 02-13-2004 08:53 AM
"Re-configure" the version of PHP that is installed with RH 7.2 jkpalmer52 Linux - Software 1 12-05-2003 01:56 PM
php ide with "break" and "trace" Kayaker Programming 3 04-25-2003 02:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:37 PM.

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
Open Source Consulting | Domain Registration