LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   "live" version of php? (https://www.linuxquestions.org/questions/linux-software-2/live-version-of-php-619637/)

konqi 02-08-2008 10:38 AM

"live" version of php?
 
Is there a way to run php files on your own computer, just like if its on a webserver?

Matir 02-08-2008 11:22 AM

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.)

konqi 02-08-2008 02:14 PM

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

Wim Sturkenboom 02-09-2008 11:21 PM

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.

konqi 02-10-2008 02:59 AM

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.

Wim Sturkenboom 02-10-2008 09:47 AM

If you want to display webpages, you need a webserver or you must except the HTML tags in your output.

b0uncer 02-10-2008 10:02 AM

Quote:

Originally Posted by konqi (Post 3052182)
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.

konqi 02-15-2008 02:35 PM

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?

danboland 02-15-2008 05:01 PM

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


All times are GMT -5. The time now is 10:11 AM.