none
expression web 4 \ abyss web server \ htdocs

    Question

  • When I load files from abyss web server into my browser the whole of the code shows up in the browser. Help please.
    Sunday, April 09, 2017 1:21 PM

All replies

  • This sounds like a question for "abyss", not Expression Web.

    Expression Web simply lets you create HTML, CSS, JavaScript, asp.net, and PHP.   Its own development server displays HTML and CSS properly, it's up to you to have JavaScript enabled in your browser to run that, and Espression Web's own development server runs those two server-side scripting languages, asp.net code and PHP (assuming PHP is installed and set up).  Setting up a different server is not within the scope of an Expression Web forum.  (Is there a reason you felt the need to set up a different server, other than the one EW comes with?)

    If you think your question really does relate to Expression Web, please re-state it with information that would connect it to Expression Web (beyond "I made the pages in Expression Web").


    Kathleen Wilber
    BrightWillow - Asp.Net Applications




    • Edited by KathyW2 Monday, April 10, 2017 3:18 AM
    Sunday, April 09, 2017 6:37 PM
  • Thanks for your reply Kathy.   I have installed php in EW4 on my computer (via the book) I have also enabled scripting on Internet Explorer via the instructions.  Unfortunately when I try to view the page on Internet Explorer I view the whole of the html & php code. It's the same for javascript.
    Tuesday, April 11, 2017 11:02 AM
  • Hi Kathy,  I have also installed Expression Development server.
    Tuesday, April 11, 2017 11:06 AM
  • Your replies don't clarify your question. If you preview using EW's development server, there is no involvement with abyss.  And, you don't install the development server - it is automatically part of EW's installation.

    Are you actually using the development server?  Or just trying to open the page in a browser (which, if you have PHP in your page, won't work, since PHP is a server side script)?

    What are your site preview settings?


    Kathleen Wilber
    BrightWillow - Asp.Net Applications


    • Edited by KathyW2 Wednesday, April 12, 2017 2:21 AM
    Wednesday, April 12, 2017 1:38 AM
  • Thanks for your reply Kathy.   I have installed php in EW4 on my computer (via the book) I have also enabled scripting on Internet Explorer via the instructions.  Unfortunately when I try to view the page on Internet Explorer I view the whole of the html & php code. It's the same for javascript.

    First, you don't have to "enable scripting' in any browser. For client-side scripting (e.g. javascript), that support is automatically enabled, and must in fact be disabled if the user so desires. For server-side scripting, such as PHP, ASP.NET, ASP, etc. that code is executed on the server, then the emitted pure HTML is sent down to the browser—the browser never sees it, wouldn't understand it if it did, and couldn't execute it.

    As for why you're seeing all of that code and markup "in the raw," I suspect it is because your syntax is so badly written that the browser does not recognize it as a Web page and is simply rendering it as plain text, which is what you are seeing. HTML is a "fail-safe" protocol, in that if the browser sees markup that it does not understand it ignores it. If you would simply post the page to your server, then provide a link here so that we can actually see the source code, we could very quickly determine exactly where the problems exist in your source code and help you to correct it.

    As for your PHP code, you need to name your page(s) with a PHP extension, and you need to point EW to the location of your php-cgi.exe file so that the code can be read and executed and converted to HTML for the browser. You need to do that in the "Tools|Application Options|General" tab, in the "Path to PHP executable..." text box. Then, in the "Site|Site Settings|Preview" tab for your site, tell EW to use the PHP executable found in Application Options. Here is a sample of the settings you need to enable:

    As you can see, I installed WAMPServer and used the PHP executable that came with it. You would point to the one that came with Abyss. You want to set it to be used for "all pages" so that the server will be started always, so that if you open a plain HTML page, then navigate from there to one of your PHP pages, the server will be running and able to execute the PHP page.

    To be honest, from here it sounds as if you have jumped into using PHP without any understanding of what it actually is and how it works. Or, for that matter, what HTML is and how it works, how it differs from server-side code or even client-side javascript, or how browsers work. This is rarely a recipe for success. I would suggest that you might want to slow down, learn to read and understand HTML markup (not just use the EW design view), and then start working with basic PHP tutorials, which will help you to understand how to set up and enable PHP, and how to write, test, and debug PHP code. Just a suggestion...  ;-)

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.

    Wednesday, April 12, 2017 5:39 AM
  • Many thanks for your reply scott.  As you can see i'm quite new to this. The php is as follows and the path is

    c:\abyss web server\htdocs\ongoing.php

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <title>Getting started with php</title>
    </head>

    <body>

    <?php

    $body_temp = 98.6;

            $body_temp;

                echo "<p>Body temperature is $body_temp degrees Faranheit";

            $body_temp = 37.0;

                echo "($body_temp degrees celcius)</p>";

    ?>

    </body>

    </html>

                                    
    Wednesday, April 12, 2017 6:59 AM
  • Showing us your php page doesn't help.  What are your site preview settings, and, if they don't include the php executable, what are your tools -> application options for php?

    If you are seeing the raw code, you are not using a server, with PHP installed and pointed to, to preview the pages.


    Kathleen Wilber
    BrightWillow - Asp.Net Applications




    • Edited by KathyW2 Wednesday, April 12, 2017 9:32 PM
    Wednesday, April 12, 2017 3:38 PM
  • It is quite clear that you have not properly configured your PHP executable. As a check, I copied and pasted your PHP code, above, into a blank PHP file in EW. Since I do, in fact, have PHP properly configured in EW, when I previewed the file the page opened in Firefox displaying the single line "Body temperature is 98.6 degrees Faranheit(37 degrees celcius)". Yes, the code as written both misspells Fahrenheit and misspells and miscapitalizes Celsius, and omits the space preceding the Celsius value. That said, the code does properly execute and emit the expected HTML when the PHP executable is correctly configured.

    In any event, what it does not do is display the raw PHP code. Since yours clearly does, you either do not have the correct "php" extension on the file, or you have not told EW where to find the PHP executable, or both (I'm betting on the latter).

    In my previous post, I described to you clearly how to configure EW to find the php-cgi.exe file. Please, READ that post, and FOLLOW the instructions. Then create a simple "testInfo.php" file with only

    <?php phpinfo(); ?>

    between the body tags. When you preview that file you will see a complete page full of information about your installed PHP version. If so, you are good to go, and you can continue to work with your tutorial book. Please, give that a try and report back. We really, truly, no bullshit, cannot help you any further until you get that executable properly configured. It is a sine qua non for previewing PHP files in EW without using an external server and a custom URL.

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.

    • Edited by paladyn Wednesday, April 12, 2017 10:50 PM
    Wednesday, April 12, 2017 10:46 PM
  • Site settings

    Checked. Preview using website url.

    Checked. Use microsoft exoression development server

    Checked. For all web pages.

    c:\program files\php7\php-cgi-exe

    Checked. Use the php executable set in the applications options

    Applications options

    Checked. Open last site automatically when expression web starts.

    Checked. Check if expression web is the default editor for pages.

    Checked.  Show status bar

    c:\program files\php7\php-cgi-exe

    Thursday, April 13, 2017 5:36 PM
  • And... ?

    Did you create the short phpInfo.php test file I requested, and ensure that the file had "php" extension? What happened when you previewed it?

    Oh, wait... I just looked again at your path to the PHP executable. If, in fact, what you have shown above is what you actually have in your settings, I see your problem. Note that you have inadvertently transmuted "php-cgi.exe" into "php-cgi-exe". Can you see that you've changed the "dot exe" into "dash exe"? EW is looking for an executable named "php-cgi-exe" at that path, and, of course, not finding it.

    It's an easy typo to make, and like many such typos, easy to overlook when scanning the full path. If your "Application Options" "Path to PHP executable..." is really as shown above, please correct it and try the short test program (the "Site Settings" will automatically update to use the value in "Application Options"), then let us know the results (although I believe that you will find that your issue has been resolved ;-).

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.

    Thursday, April 13, 2017 7:22 PM
  • Hi scott,  php-cgi-exe was a typo as you said.   Created phpinfo.php file.  Did not resolve the problem.

    To go back to basics. 

    In the EW4 book page 382 section 4.( fig 22.2 web server setup) it states;  You do not need to set up a web server (that's what the EW server is for) so select "Do not set up a web server" unless you plan to use the web server for something else.

    I have now downloaded php 3 times.  (fig 22.2 web server setup )box did not appear on any occasion.  I wonder if that's the problem.

    EW4 book is for version 5.3.2

    Latest version is 7.1.0

    Saturday, April 15, 2017 4:08 PM
  • Referencing a figure in a book doesn't help. We don't have your book, or even know which EW4 book you are talking about.

    Which PHP did you install?  The one for Windows?   Give us a link to exactly the page you downloaded it from, and tell us which choice you made (which download link you used).

    Did you read the install.txt file?  Did you follow the instructions to copy the production or development php init file to php.ini?  Did you then edit that file and change

    ;cgi.force_redirect = 1

    to

    cgi.force_redirect = 0

    If you used the correct download, and made the change to the php.ini file, things should work.


    Kathleen Wilber
    BrightWillow - Asp.Net Applications



    • Edited by KathyW2 Saturday, April 15, 2017 4:55 PM
    Saturday, April 15, 2017 4:14 PM
  • Actually, I found to my surprise that my PHP pages executed and rendered quite satisfactorily from EW without disabling cgi.force_redirect. I've only tried simple test pages I had created some time ago, but, for example, the phpinfo() test worked just fine.

    Still, as it states in the php.ini comments for that value, it should be disabled for Windows servers, so go ahead and do it as Kathy said. Since I don't know what consequences may pertain if I use some PHP functionality not employed in my test pages, I have now disabled it.

    Frankly, I didn't have to do any of that stuff. I just installed WAMPServer2, then pointed EW to the executable (by default, <install_drive>\wamp\bin\php\php5.3.4\php-cgi.exe). My php.ini is the one that was installed by default with WAMPServer, and that seems to have done it.

    Your problem is clearly that you have either not properly installed PHP (and prepared the correct php.ini), or you have not pointed EW to the resulting executable. Once you have done that your issue will be resolved. That has to be done by you, on your machine. We have already told you literally everything that you need to know to accomplish this end. There is nothing more that we can suggest. Please let us know when you find out what the problem was. Thanks.

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.

    Saturday, April 15, 2017 8:38 PM
  • It may depend on what version of PHP you are using, and what behavior cgi.force_redirect defaults to.

    I tried it with the latest version 7, since the original poster was using version 7, and I needed to make that explicit change for phpinfo to show anything other than a blank page, using EW's development server.  I can edit it back, commenting it out:  blank page again.  Set it explicitly to 0 again: phpinfo shows.  So, I recommend maxwell make that change.


    Kathleen Wilber
    BrightWillow - Asp.Net Applications


    • Edited by KathyW2 Sunday, April 16, 2017 2:49 PM
    Sunday, April 16, 2017 2:48 PM
  • Many many thanks for your input so far.  Although my problem still exists, I could not have come this far without your advice. I will now go away and study to gain a more grounded knowledge base.
    1 hour 26 minutes ago