Jump to content

Simple PHP Interpreter?


banjo
 Share

Recommended Posts

I have been forced to exchange my index.shtml for index.php to get around a failed hit counter written in perl. The new index.php page and its new hit counter are working fine with php, but the only way I can view it is by uploading it to the host.

 

Is there a simple php interpreter that I can run locally, short of installing Apache, to view my file before uploading it? I am not trying to debug the PHP locally. The php in it is so simple that it is a tiny part of the page. I just want to be able to see the content of the page before uploading it. Firefox just bails out on the whole file because there is no php on this computer.

 

I can edit the file as a .html file, live through the php errors, and then rename to .php for upload, but that is a pain in the neck and error prone. Having a simple, standalone php interpreter would be better. I need to convince Firefox to display the file even though it is a .php file, even if it just throws out the php code.

 

Ideas, thoughts, dope-slaps?

 

Thanks,

Banjo

(_)=='=~

Link to comment
Share on other sites

I think I have found an answer to this, so I apologize for posting a question to the forum needlessly. I have installed XAMPP,and it appears to work fine.

 

http://www.apachefriends.org/en/xampp.html

 

Unfortunately, this is more trouble than copying the file from .html to .php and then uploading because I have to run lampp as root and install the web page in /opt/lamp/htdocs/ in order to see it. If I were going to try to trouble-shoot some more complex PHP, this would be a dream utility. It is dead easy to install and works as advertised. But for simply viewing the html contents of the file it is more steps than my copy trick.

 

I plan on leaving this utility permanently installed for future use. It looks like a great tool.

 

Banjo

(_)=='=~

Link to comment
Share on other sites

Yes, but something different is going on because the "installation" involved only unzipping a tar file into /opt. There were no packages or configuration involved.

 

If I try to find php, I get:

 

$ which php
which: no php in (/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin/:/usr/games:/usr/lib/qt4/bin)

 

I suppose I could edit my path to find it down in /opt.

 

I had previously installed MySQL, but it is not running ( no daemon ). If I query the package manager:

 

[root@localhost lampp]# rpm -qa | grep apache
[root@localhost lampp]# rpm -qa | grep php
[root@localhost lampp]# rpm -qa | grep mysql
mysql-core-5.1.58-0.1mdv2010.2
perl-DBD-mysql-4.14.0-4mdv2010.1
mysql-client-5.1.58-0.1mdv2010.2
libmysql16-5.1.58-0.1mdv2010.2
mysql-common-5.1.58-0.1mdv2010.2
qt4-database-plugin-mysql-4.6.3-0.2mdv2010.2
mysql-common-core-5.1.58-0.1mdv2010.2
[root@localhost lampp]# 

 

The package manager only recognizes the previously installed MySQL, but not the other two. It does find perl as well, but I think I had previously installed perl ( I don't remember ). Does this mean that I have two copies of those programs installed on the computer?

 

Yet when I start lampp, it all works. Somehow it is doing an end-around-run past the package manager.

 

Very strange. I am not complaining because it looks to be very useful and simple. I am just puzzled about how all of this is hanging together.

 

Banjo

(_)=='=~

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...