Jump to content
  • Announcements

    • spinynorman

      Mandriva Official Documentation

      Official documentation for extant versions of Mandriva can be found at doc.mandriva.com.   Documentation for the latest release may take some time to appear there. You can install all the manuals from the main repository if you have Mandriva installed - files are prefixed mandriva-doc.
    • paul

      Forum software upgrade   10/29/17

      So you may have noticed the forum software has upgraded !!!
      A few things that have changed. We no longer have community blogs (was never really used) We no longer have a portal page.
      We can discuss this, and decide whether it is needed (It costs money) See this thread: Here

Simple PHP Interpreter?

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?





Share this post

Link to post
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.




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.




Share this post

Link to post
Share on other sites

What you've done is install Apache, MySQL, PHP and Perl all in one, without separately installing the packages with urpmi or MCC :)

Share this post

Link to post
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
[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.




Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now