Newbie to PHP - Displaying local PHP Files 
Author Message
 Newbie to PHP - Displaying local PHP Files

I'm very new to PHP.   So, please excuse my ignorance.  But, I have a
question.  Is there a way to display the output of a PHP file before
uploading it to a webserver?   I'm aware that PHP is for server-side
scripting.  But, it would be nice to test the functionality of my PHP script
without having to upload first.
Thanks in advance.

--
Bob Kaku

http://www.*-*-*.com/



Thu, 30 Jun 2005 04:08:17 GMT  
 Newbie to PHP - Displaying local PHP Files
|| I'm very new to PHP.   So, please excuse my ignorance.  But, I have a
|| question.  Is there a way to display the output of a PHP file before
|| uploading it to a webserver?   I'm aware that PHP is for server-side
|| scripting.  But, it would be nice to test the functionality of my
|| PHP script without having to upload first.
|| Thanks in advance.
No thats not possible, de commands are giving from de server.So you first
got to upload your PHP files and then execute the PHP files.

--



Thu, 30 Jun 2005 05:01:27 GMT  
 Newbie to PHP - Displaying local PHP Files

Quote:

>I'm very new to PHP.   So, please excuse my ignorance.  But, I have a
>question.  Is there a way to display the output of a PHP file before
>uploading it to a webserver?   I'm aware that PHP is for server-side
>scripting.  But, it would be nice to test the functionality of my PHP script
>without having to upload first.

You need to install the PHP interpreter on your system. Then you
can either execute scripts from the commandline:
php -q myscript.php
or you can also install a server locally and call the script that way:
http://localhost/myscript.php

Maybe it would be easier to upload the script in some secret
directory so you can execute it, but no one else knows about it.

Arnoud

--
Arnoud Engelfriet, Dutch patent attorney - Speaking only for myself
Patents, copyright and IPR explained for techies: http://www.iusmentis.com/



Thu, 30 Jun 2005 05:36:20 GMT  
 Newbie to PHP - Displaying local PHP Files


Quote:
>I'm very new to PHP.   So, please excuse my ignorance.  But, I have a
>question.  Is there a way to display the output of a PHP file before
>uploading it to a webserver?   I'm aware that PHP is for server-side
>scripting.  But, it would be nice to test the functionality of my PHP script
>without having to upload first.

Nope, you need to install PHP and a web server on your local machine
to see the output of the files.

For PHP, see http://www.php.net/downloads.php

For a webserver, I'd recommend Apache:
http://httpd.apache.org/download.cgi

-Ray



Thu, 30 Jun 2005 06:54:11 GMT  
 Newbie to PHP - Displaying local PHP Files

thus:

Quote:
>I'm very new to PHP.   So, please excuse my ignorance.  But, I have a
>question.  Is there a way to display the output of a PHP file before
>uploading it to a webserver?   I'm aware that PHP is for server-side
>scripting.  But, it would be nice to test the functionality of my PHP script
>without having to upload first.
>Thanks in advance.

        If you want to easily install a php server on your own machine, but
don't want to have to compile everything yourself, have a look at phpdev.
Download it, run it, then you've got a functioning Apache web server with
php, mysql, and gd libraries.  The address is
http://www.firepages.com.au/dev4.htm.  Good luck.

--
Ben Green.



Thu, 30 Jun 2005 10:46:14 GMT  
 Newbie to PHP - Displaying local PHP Files

Quote:


>|| I'm very new to PHP.  So, please excuse my ignorance.  But, I have
>|| a question.  Is there a way to display the output of a PHP file
>|| before uploading it to a webserver?  I'm aware that PHP is for
>|| server-side scripting.  But, it would be nice to test the
>|| functionality of my PHP script without having to upload first.
>|| Thanks in advance.
> No thats not possible, de commands are giving from de server.So you
> first got to upload your PHP files and then execute the PHP files.

Wrong. Just run the standalone 'php' program with your script. More
here: http://se.php.net/manual/en/features.commandline.php


Thu, 30 Jun 2005 20:45:39 GMT  
 Newbie to PHP - Displaying local PHP Files

Quote:


>thus:

>>I'm very new to PHP.   So, please excuse my ignorance.  But, I have a
>>question.  Is there a way to display the output of a PHP file before
>>uploading it to a webserver?   I'm aware that PHP is for server-side
>>scripting.  But, it would be nice to test the functionality of my PHP script
>>without having to upload first.
>>Thanks in advance.

>    If you want to easily install a php server on your own machine, but
>don't want to have to compile everything yourself, have a look at phpdev.
>Download it, run it, then you've got a functioning Apache web server with
>php, mysql, and gd libraries.  The address is
>http://www.firepages.com.au/dev4.htm.  Good luck.

Ben,

This was the best tip for a newb in a long time. I downloaded this
last night, extracted the zip and BAM! My phpinfo worked! How cool is
that.
So why doesn't PHP work? Meaning,  In the c:\phpdev is a batch file to
start Apache 1.3.20 (WIN32) and PHP/4.0.6 and i get a message that
it's running. Also Explorer opens a yak.html file locally at
C:\phpdev\www\yaks.html. From there you click to begin, and you are
brought to a page at http://localhost/phpdev4/index.htm whcih you can
then click a link to see your local phpinfo at
http://localhost/phpdev4/phpinfo.php

That's all well and good but I put a file that does a simple include
in my document root at:
 DOCUMENT_ROOT c:/phpdev/www
my index page displays but not with my included header. Here is my
include code:
<?php include("header.php"); ?>

So what gives?

Really appreciate the help,
Ron



Fri, 01 Jul 2005 01:30:21 GMT  
 Newbie to PHP - Displaying local PHP Files

Quote:
> I'm very new to PHP.   So, please excuse my ignorance.  But, I have a
> question.  Is there a way to display the output of a PHP file before
> uploading it to a webserver?   I'm aware that PHP is for server-side
> scripting.  But, it would be nice to test the functionality of my PHP
script
> without having to upload first.
> Thanks in advance.

You could also install phpTriad on your system. It's a Windows installer
with PHP, Apache and MySQL built into it. It sets up very easily and takes
away most of the hassle of setting up a local web server for testing
against.

Paul



Fri, 01 Jul 2005 02:23:54 GMT  
 Newbie to PHP - Displaying local PHP Files


<snip>

Quote:
>include code:
><?php include("header.php"); ?>

>So what gives?

>Really appreciate the help,
>Ron

Nevermind. Made it work.

thx..ron



Fri, 01 Jul 2005 11:46:55 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. different PHP-Version with differengt php.ini files?

2. UTF8 php files are not interpreted by PHP ! :-(

3. Newbie - Multi HTML pages in one PHP file

4. php newsgroup [ alt.php ]

5. install PHP 4.2 and PHP 4.3 on the same host

6. Calling PHP Code Snippets within PHP Application

7. php mysql sample code php shareware like KB knowledgebase

8. Apache + PHP not processing php

9. FLEX / BISON generator for PHP (JavaCC for PHP!)

10. Help: PHP works with .php but not .html

11. PHP+MySQL vs. PHP+PostgreSQL

12. php + mysql or php + postgresql?

 

 
Powered by phpBB® Forum Software