PHP Preview Help

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
Post Reply
Sig_ZA
Posts: 6
Joined: Sat Jan 06, 2007 12:04 pm
Location: South of the Equator

PHP Preview Help

Post by Sig_ZA »

Version 9.52, XPproSP3, PHP5.2.8

I can't seem to get the PHP Preview option to work, either with the Preview Panel or previewing using IE8.

I have followed these instructions http://kb.blumentals.net/kb/index.php?V ... EntryID=84:
To enable the built-in web server:
On the Options menu, click Preferences.
Under Preview - Mappings uncheck Use mappings;
Under Preview - Script Preview check the option Use built-in web server;
Click Web Server Settings and specify the path to php-cgi.exe (or eRuby.exe) file. If you do not have the PHP (or eRuby) interpreter on your computer, you must download and install it. Click here to download a self-installing PHP package.
The only difference being that I point to php.exe (or php-win.exe seems to make no difference) from the PHP Settings option and the Webserver settings option.

Preview of non-php pages work, but if the page contains php (like the default 'hello world' default script) the system hangs and the hour glass just sits there. If I try to shut down Rapid I get a message that the internal webserver cannot be stopped. I have tried disabling the firewall (zonealarm), but this makes no difference.

Help please... :?
Sig_ZA
Posts: 6
Joined: Sat Jan 06, 2007 12:04 pm
Location: South of the Equator

Re: PHP Preview Help

Post by Sig_ZA »

BUMP
Gatis
Blumentals Software Developer
Posts: 545
Joined: Sun Mar 05, 2006 12:30 am
Location: Latvia

Re: PHP Preview Help

Post by Gatis »

The knowledge base article you were mentioning, describes how to set up an internal web server in WeBuilder.
But then you say, it does not work also on IE8. You can NOT preview PHP scripts in IE8 if you have no external web server installed on your computer.

Then you also mention
The only difference being that I point to php.exe
But in the article it is said, you need to specify path to php-cgi.exe.
Please try to use the pre-configured and self-installing package:
http://www.blumentals.net/download/php.php
Kind regards,
Gatis Avots
Sig_ZA
Posts: 6
Joined: Sat Jan 06, 2007 12:04 pm
Location: South of the Equator

Re: PHP Preview Help

Post by Sig_ZA »

Thanks. I missed the cgi bit.
rpal
Posts: 5
Joined: Mon Jul 27, 2009 8:26 am

Re: PHP Preview Help

Post by rpal »

I have exactly the same problem described. My intalled browsers are FF3 and IE7. Product is configured to point to c:\Program Files\PHP5.3\php-cgi.exe. Status of Windows firewall makes no difference. I'm evaluating product for adoption by our web team and this is a critical issue for us to get working. Have used several evaluation usages trying to get this to work. Any help much appreciated.
User avatar
chrisjlocke
Top Contributor
Posts: 995
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK
Contact:

Re: PHP Preview Help

Post by chrisjlocke »

rpal- What symptoms are you experiencing? Have you tried the installer as suggested by Gatis?
Personally, I'd recommend Xampp, as its a full-blown webserver, PHP, MySQL, etc and runs very well. Its a doddle to set up, and run in minutes. Fully compatible with WeBuilder, etc.

http://www.apachefriends.org/en/xampp.html
rpal
Posts: 5
Joined: Mon Jul 27, 2009 8:26 am

Re: PHP Preview Help

Post by rpal »

chrisjlocke wrote:rpal- What symptoms are you experiencing? Have you tried the installer as suggested by Gatis?
Personally, I'd recommend Xampp, as its a full-blown webserver, PHP, MySQL, etc and runs very well. Its a doddle to set up, and run in minutes. Fully compatible with WeBuilder, etc.

http://www.apachefriends.org/en/xampp.html
After following steps in the article cited by Sig_ZA (basically same as in RapidPHP Help), the preview is just a big empty white space with an hourglass cursor that hangs there until I get out of preview. I did not use the php download at http://www.blumentals.net/download/php.php becase the link did not work. I downloaded PHP directly from the PHP site and used the webserver setup option in RapidPHP to specify the location of php-cgi.exe.

Thanks for the tip re: xampp - I will look into that.
User avatar
Karlis
Site Admin
Posts: 3605
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe
Contact:

Re: PHP Preview Help

Post by Karlis »

The blank screen might be because the PHP you downloaded is not configured in a way so that the insernal web server can use it.

IF for some reason you can not use the internal web server (which seems to be the case), you must install an external one. But you MUST have web server software. Installing only PHP will not do. XAMPP is a good choice.
Karlis Blumentals
Blumentals Software
www.blumentals.net
User avatar
chrisjlocke
Top Contributor
Posts: 995
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK
Contact:

Re: PHP Preview Help

Post by chrisjlocke »

rpal wrote:... becase the link did not work.
Works fine for me.

Please let me know how you get on with Xampp. I can do a screencam example of how to set it up if you get stuck. I'd recommend it over the built-in webserver, as you can then do database stuff with MySQL, etc. Its worth it to get it going. Please keep me posted. This sort of question comes up a lot, and I'd like to sort out a permanent solution.
rpal
Posts: 5
Joined: Mon Jul 27, 2009 8:26 am

Re: PHP Preview Help

Post by rpal »

Please bear with me here - I'm just learning my way around PHP. Background is Delphi for programming & HTML/CSS for web. I downloaded the suggested PHP version (the link got fixed) and now I am getting error messages which have to do with our main config.inc.php file. That defines docroot and siteroot, and I recall our PHP developer has different versions on our staging and live servers, and I think I need to change my local copy to point to the local webserver. I tried a couple of experiments with "localhost" and "file:///" but I guess I'm not doing the settings right. I show the relevant code from the config include below and wonder if someone can advise how to alter it so it will run with the local web server of RapidPHP and the locally installed PHP (paths to each shown below):

Code: Select all

<?php
error_reporting(E_ALL ^ E_NOTICE);
ini_set('session.use_trans_sid','0');

// I need to get these right for the local web server:
   $siteroot = "http://staging.ourdomain.com/mainsite";
   $docroot = "/var/www/html/mainsite";

function userStatusText ($noString,$yesString){
global $logged_in;
if($logged_in == "no")
	{
	echo $noString;
	}
	else
	{
	echo $yesString;
	}
}

include($docroot."/inc/curr_alm_ver.inc.php");
include($docroot."/inc/alm_file_sizes.inc.php");
include($docroot."/inc/curr_tw_ver.inc.php");
include($docroot."/inc/curr_req_ver.inc.php");
?>
RapidPHP Installed on: C:\Program Files\Rapid PHP 2008
PHP installed on C:\php526xd
rpal
Posts: 5
Joined: Mon Jul 27, 2009 8:26 am

Re: PHP Preview Help

Post by rpal »

chrisjlocke wrote:
rpal wrote:... becase the link did not work.
Works fine for me.

Please let me know how you get on with Xampp. I can do a screencam example of how to set it up if you get stuck. I'd recommend it over the built-in webserver, as you can then do database stuff with MySQL, etc. Its worth it to get it going. Please keep me posted. This sort of question comes up a lot, and I'd like to sort out a permanent solution.
Xampp seemed pretty straightforward to set up. Its control panel reports Apache running on port 80 but mapping in RapidPHP didn't work. I thought I'd better verify that Apache was working, so I put a bare-bones html file in the c:/xamp/htdocs folder and tried http://localhost/test.html and http://localhost:80/test.html in my browser but the page is not getting served. I can't really try mappings in RapidPHP until I can get the server working. Any tips much appreicated.
User avatar
chrisjlocke
Top Contributor
Posts: 995
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK
Contact:

Re: PHP Preview Help

Post by chrisjlocke »

Is anything getting served? If you go to http://localhost do you get the xampp welcome screen?
rpal
Posts: 5
Joined: Mon Jul 27, 2009 8:26 am

Re: PHP Preview Help

Post by rpal »

No.
From Desktop I start XAMPP control panel. In control panel I click Start button for Apache (Svc box not checked). Panel reports "Apache started [Port 80].

http://localhost turns up blank screen in browser.
Last edited by chrisjlocke on Mon Aug 03, 2009 10:23 pm, edited 1 time in total.
Reason: Removed quoting
User avatar
Karlis
Site Admin
Posts: 3605
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe
Contact:

Re: PHP Preview Help

Post by Karlis »

Is it a blank screen or page not found or error message?

You should get some welcome message there. It appears that xampp is not working properly for you. Probably due to firewall or some security software blocking it?
Karlis Blumentals
Blumentals Software
www.blumentals.net
Post Reply