none
PHP not seeing $_GET['record'] from url .....WEB Expressions development server question

    Question

  • I've got Expressions WEB 3.0 on Windows 7 and have installed php.exe on the box. The preview works for most the php code but when it looks for the string on the end of the url as in:      http://localhost:46274/ESinstruments/index.php?record =band

    the php interpreter flags an error saying:     Notice: Undefined index: record in C:\Users\Bob\Documents\OrcasPets\ESinstruments\index.php on line 105 

    Line 105 is:   $itemType = $_GET['record '];

    So, I take it that the php interpreter is not getting the url line from the development server. Anyone able to help me with this?
    Monday, September 21, 2009 5:59 AM

Answers

  • OK, thought I remembered this correctly. Use the WAMPServer control panel to open php.ini, then search for this section:

    ; cgi.force_redirect is necessary to provide security running PHP as a CGI under
    ; most web servers.  Left undefined, PHP turns this on by default.  You can
    ; turn it off here AT YOUR OWN RISK
    ; **You CAN safely turn this off for IIS, in fact, you MUST.**
    ; cgi.force_redirect = 1
     
    IIRC, it comes by default with the final line enabled (no leading semi-colon). Just add a semi-colon at the start of the line to disable it and save the file. I don't remember right off hand if it is necessary to shut down and restart the server (I don't think so, since you're not actually using the server from EW unless you explicitly decide to). In any event, it takes no time to do so if you wish.

    Give it a try and report back. I'm really curious to see if this is a dev server issue or something in the previous php configuration.

    cheers,
    scott
    Plural's don't have apostrophe's. It seem's sometime's that any word's ending in "s" get a gratuitous apostrophe. Apostrophe's are used to indicate possessive's and elision's (contraction's or abbreviation's).
    • Marked as answer by Time Bandit Monday, April 05, 2010 3:35 AM
    Tuesday, September 22, 2009 4:05 AM

All replies

  • Is there really a space between record and =band?  That would cause the error, of course, if so.
    Monday, September 21, 2009 6:29 AM
  • No, this forum is adding those spaces you see. I went back and edited them out of my post but upon Submitting, the spaces were added back in again. In the actual code the spaces are not there and the page is also currently a live working animal on a Linux-PHP-MySQL server and it works quit well. That's why I picked it to see if I could get the Expressions development server to work.

    Also note worthy, is that even when there is nothing on the url after the "ESinstruments.php" the code $itemType = $_GET['record '] should return "null" so that the next line which is a test of $itemType=='band' returns false. What is happening in this case is that  $itemType = $_GET['record '] is returning "undefined" which implies there is nothing from the development server pointing to the url.
    Monday, September 21, 2009 6:46 AM
  • All I can say is that I can write a simple PHP page that uses a variable passed in the URL, and it works on the development server.

    Trivial example:

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    
    <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    <title>Untitled 1</title>
    </head>
    
    <body>
    <p>The word passed in the URL is: </p>
    <?php 
    // for example: wordvariable.php?word=abracadabra 
    
    $val = $_GET['word']; 
    echo "$val"; 
    
    ?>
    </body>
    
    </html>



    If I the development server shows that page at http://localhost:62480/testphpurl/wordvariable.php, and I enter a URL in the development server of:

    http://localhost:62480/testphpurl/wordvariable.php?word=hello

    The resulting displayed page is:

                    The word passed in the URL is:

                    hello

    See if this trivial test works for you.  If not, there's a fundamental issue with your setup.

    Monday, September 21, 2009 7:30 AM
  • Also note worthy, is that even when there is nothing on the url after the "ESinstruments.php" the code $itemType = $_GET['record '] should return "null" so that the next line which is a test of $itemType=='band' returns false. What is happening in this case is that  $itemType = $_GET['record '] is returning "undefined" which implies there is nothing from the development server pointing to the url.
    That's not true.  It shouldn't return Null.  Since its undefined then it shoud, in a proper case, return an error that its undefined.  This is why you should always check for the presence of a query parameter using the isset() function.

    What its returning if nothing is enter is correct.

    --
    Chris Hanscom - Microsoft MVP
    On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help

    Get a Complete Website Analysis by Veign
    Monday, September 21, 2009 1:41 PM

  • Thanks for your attention to my problem.

    I entered your example and it didn't work for me. As soon as it is previewed in my browser it opens with:

    The word passed in the URL is:

    Notice: Undefined index: word in C:\Users\Bob\Documents\OrcasPets\word_passed_in_the_url_is.php on line 14


    If I do a test of the query parameter as Veign suggests....

    <?php
    // for example: wordvariable.php?word=abracadabra
    if(isset($_GET['word'])){
        $val = $_GET['word'];
        echo "$val";
    }
    ?>


    Then this url:  http://localhost:51146/word_passed_in_the_url_is.php?word=happytime

    no longer produces an error but it does nothing.

    I do notice there is a difference in the url that is in the browser url line and that reported by the php error. Is that a lead or just the magic of windows 7?
    Monday, September 21, 2009 3:56 PM
  • What version of PHP are your using? What does var_dump($_GET); show?  What if you include phpinfo() in the page - what variables does it show?

    --
    Chris Hanscom - Microsoft MVP
    On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help

    Get a Complete Website Analysis by Veign
    Monday, September 21, 2009 4:28 PM
  • Bandit, I copied Kathy's example verbatim and pasted it directly into EW2. When I ran it from the IDE (i.e. no QueryString param) I got the undefined error you describe. When I tacked on the QueryString "?word=abracadabra," I got this:

    The word passed in the URL is:

    abracadabra

    When I wrap it with an isset test on the QueryString param, so

    <p>The word passed in the URL is: </p>
    <?php
    // for example: wordvariable.php?word=abracadabra

    if(isset($_GET['word'])){
     $val = $_GET['word'];
     echo "$val";
    }
    ?>

    then I get just

    The word passed in the URL is:

    without the undefined error, as expected.

    I don't know what you are doing wrong, but you are clearly doing something wrong, because the example code works exactly as described.

    cheers,
    scott


    Plural's don't have apostrophe's. It seem's sometime's that any word's ending in "s" get a gratuitous apostrophe. Apostrophe's are used to indicate possessive's and elision's (contraction's or abbreviation's).
    Monday, September 21, 2009 4:45 PM
  • OK, I ran these and with a command line of:  http://localhost:51146/word_passed_in_the_url_is.php?word=happytime

    var_dump($_GET) shows: array(0) { }


    phpinfo() shows:

    phpinfo() PHP Version => 5.3.0 System => Windows NT BOB-DEVELOPER 6.1 build 7100 ((null)) i586 Build Date => Jun 29 2009 21:42:21 Compiler => MSVC9 (Visual C++ 2008) Architecture => x86 Configure Command => cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--disable-zts" "--disable-isapi" "--disable-nsapi" "--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared" "--with-enchant=shared" Server API => Command Line Interface Virtual Directory Support => disabled Configuration File (php.ini) Path => C:\Windows Loaded Configuration File => C:\Program Files\PHP\php.ini Scan this dir for additional .ini files => (none) Additional .ini files parsed => (none) PHP API => 20090626 PHP Extension => 20090626 Zend Extension => 220090626 Zend Extension Build => API220090626,NTS,VC9 PHP Extension Build => API20090626,NTS,VC9 Debug Build => no Thread Safety => disabled Zend Memory Manager => enabled Zend Multibyte Support => disabled IPv6 Support => enabled Registered PHP Streams => php, file, glob, data, http, ftp, zip, compress.zlib, phar Registered Stream Socket Transports => tcp, udp Registered Stream Filters => convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, zlib.* This program makes use of the Zend Scripting Language Engine: Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

    AND A LOT MORE. What would you be interested in here? It seems to me that phpinfo() provided a formatted string output rather than this array notation showing.

    Thanks for your thoughts.
    Monday, September 21, 2009 5:02 PM
  • Try downloading and installing WAMP and see what happens.  I run WAMP or IIS to test PHP applications and have never had a problem.  It could be somthing in the PHP.ini file although, based on your error, I have no idea what.

    What happens if you try to access the value through $_REQUEST?  This is not a good method for production use but I want to see if that gets set.
    --
    Chris Hanscom - Microsoft MVP
    On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help

    Get a Complete Website Analysis by Veign
    Monday, September 21, 2009 5:22 PM
  • I see from phpinfo() that:

    REQUEST_URI => /word_passed_in_the_url_is.php?word=happy
    QUERY_STRING => word=happy
    _SERVER["QUERY_STRING"] => word=happy
    
    
    Which clearly shows the correct url line and Query string. So there must be something in the php.ini that doesn't allow the $_GET to see it. 

    I have done the WAMP route before but I haven't looked to see if they have a Windows 7 tested package.

    p.s. To get the phpinfo() to show readable I needed to surround the output with <pre></pre> tags.

    Monday, September 21, 2009 5:32 PM
  • What happens if you try to access the value through $_REQUEST?  This is not a good method for production use but I want to see if that gets set.
    <?php
    var_dump($_REQUEST);
    var_dump($_GET);
    ?>
    array(0) {
    }
    array(0) {
    }
    
    Monday, September 21, 2009 5:43 PM
  • Might want to try searching the PHP forum/website as I have never heard of or come across your problem and I have been doing PHP for years, on many servers for clients.

    The reason for the WAMP route is to rule out the EW server as its not a production server.  This is why I don't test in it.  I want to use a server that is used in a production environment: IIS or Apache.  What you could do is install Wamp, test.  If it works, backup the Wamp PHP.ini file and copy the one in use by EW's server.  If it works again, then its the EW server, if it fails then its a PHP.INI setting which a simple file comarison should find.
    --
    Chris Hanscom - Microsoft MVP
    On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help

    Get a Complete Website Analysis by Veign
    Monday, September 21, 2009 5:46 PM
  • Chris,

    We've already demonstrated that the development server is perfectly capable of passing parameters in the URL.  (See mine and Scott's posts.)

    I suspect it's something in the php.ini file, but I don't know what.
    Monday, September 21, 2009 5:53 PM
  • To troubleshoot its better to systematically rule things out.  I never make the assumption, on a non-standard system, that just because a few got it working that it will work in all cases.  We don't know the exact makeup of his system and how the server interacts with it.  Since the EW server is not meant for production, I would venture a guess that it hasn't been tested to the same level as IIS or Apache.
    --
    Chris Hanscom - Microsoft MVP
    On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help

    Get a Complete Website Analysis by Veign
    Monday, September 21, 2009 5:59 PM
  • At least that's working as it should.  If its not set in the GET array then it should not be set in the REQUEST array.  Without further testing and ruling out the server and ini file there's not much more I could help with.

    If you want use the contact form on Veign.com and email me your PHP.ini file - make sure to identify yourself in the email.
    --
    Chris Hanscom - Microsoft MVP
    On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help

    Get a Complete Website Analysis by Veign
    Monday, September 21, 2009 6:03 PM
  • Does $http_get_vars['word'] get set by any chance? - this is an old deprecated method.

    And in your PHP.ini file what is register_globals set to?

    --
    Chris Hanscom - Microsoft MVP
    On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help

    Get a Complete Website Analysis by Veign
    Monday, September 21, 2009 6:09 PM
  • Does $http_get_vars['word'] get set by any chance? - this is an old deprecated method.
    The $http_get_vars['word'] variable is also undefined. I just sent you a copy of my php.ini file. I beleive at this point the problem is not an EW3 problem but a php problem so unless you can pull the rabbit out of the hat with that ini file, I'm going to look for a PHP board. Any suggestions?

    I'm wondering if this is a Windows 7 thing. I was having trouble with Expressions WEB 2.0 getting confused about what directory it was in. It would open a file from my library but it was never able to save it there, it would save it directly under My Docs and then there would be two instances of the file open. Because of that problem I downloaded Expressions WEB 3 and it has no sign of that problem. Maybe PHP is not Windows 7 phantom directory smart?
    • Edited by Time Bandit Monday, September 21, 2009 6:33 PM
    Monday, September 21, 2009 6:21 PM
  • I just looked at your php.ini file as compared to mine and they are virtually the same.   If you find an answer post back here as I'm curious what the problem is.

    Also, before you give up here try Wamp - takes only 5min to install and run - and see if it works.
    --
    Chris Hanscom - Microsoft MVP
    On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help

    Get a Complete Website Analysis by Veign
    Monday, September 21, 2009 6:33 PM
  • I don't know how much this contributes to the situation, if anything, but the version of php-cgi.exe that my EW installation uses for PHP is the 5.2.8 version installed with WAMPServer 2. I have only made a couple of minor modifications to the default php.ini file as installed at that time. If the ini file is diffable, I'll be happy to send it along for comparison if you think that it would help.

    cheers,
    scott
    Plural's don't have apostrophe's. It seem's sometime's that any word's ending in "s" get a gratuitous apostrophe. Apostrophe's are used to indicate possessive's and elision's (contraction's or abbreviation's).
    Monday, September 21, 2009 6:34 PM
  • I'm wondering if this is a Windows 7 thing. I was having trouble with Expressions WEB 2.0 getting confused about what directory it was in. It would open a file from my library but it was never able to save it there, it would save it directly under My Docs and then there would be two instances of the file open. Because of that problem I downloaded Expressions WEB 3 and it has no sign of that problem. Maybe PHP is not Windows 7 phantom directory smart?
    That I don't know as I don't run Win7 and I'm sure not enough people have to get good hits in Google with the problem.

    --
    Chris Hanscom - Microsoft MVP
    On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help

    Get a Complete Website Analysis by Veign
    Monday, September 21, 2009 6:37 PM
  • Scott,
    I don't think its a php.ini file problem.  I still think its an EW server problem.
    --
    Chris Hanscom - Microsoft MVP
    On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help

    Get a Complete Website Analysis by Veign
    Monday, September 21, 2009 6:40 PM
  • I'm wondering if this is a Windows 7 thing.

    I'm having exactly the same problem on a WinXP system running PHP 5.2.10.  I think that I've tried just about every option in PHP.ini to no avail.
    Monday, September 21, 2009 6:46 PM
  • I'm wondering if this is a Windows 7 thing.

    I'm having exactly the same problem on a WinXP system running PHP 5.2.10.  I think that I've tried just about every option in PHP.ini to no avail.


    Using the EW server? 

    --
    Chris Hanscom - Microsoft MVP
    On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help

    Get a Complete Website Analysis by Veign
    Monday, September 21, 2009 6:52 PM
  • Using the EW server? 

    As soon as I posted I realized that I forgot to mention that.  EW is 3.0.1762.0
    Monday, September 21, 2009 7:05 PM
  • Same as the advice to the OP.  I would:
    "What you could do is install Wamp, test.  If it works, backup the Wamp PHP.ini file and copy the one in use by EW's server.  If it works again, then its the EW server, if it fails then its a PHP.INI setting which a simple file comarison should find."


    --
    Chris Hanscom - Microsoft MVP
    On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help

    Get a Complete Website Analysis by Veign
    Monday, September 21, 2009 7:14 PM
  • "I still think its an EW server problem."

    I have no trouble running my example on Win XP Home (PHP version 5.2.5, EW2 or EW3) or Vista Ultimate 64 bit (PHP 5.2.8, EW2 or EW3).  I don't run Windows 7, so don't know if that's part of the problem.
    Monday, September 21, 2009 7:48 PM
  • I don't think the problem is related to the Windows 7 directory system anymore. I moved the source into a directory "test" in the root and opened it as a new site. The problem persists and I think the following output is a concise revelation/example:

    url:   http://localhost:38094/word_passed_in_the_url_is.php?madAs=Rush


    Output:

    _SERVER["QUERY_STRING"]: madAs=Rush
    _SERVER["REQUEST_URI"]: /word_passed_in_the_url_is.php?madAs=Rush
    var_dump($_REQUEST): array(0) { }
    var_dump($_GET): array(0) { }


    Code:


    <?php
    echo '<br>_SERVER["QUERY_STRING"]:    ' . $_SERVER["QUERY_STRING"];
    echo '<br>_SERVER["REQUEST_URI"]:    ' . $_SERVER["REQUEST_URI"];
    echo '<br>var_dump($_REQUEST):   ';
    var_dump($_REQUEST);
    echo '<br>var_dump($_GET):   ';
    var_dump($_GET);
    ?>
     

    There is just nothing in $_GET





    Monday, September 21, 2009 8:38 PM
  • Veign: The reason for the WAMP route is to rule out the EW server as its not a production server.  This is why I don't test in it.  I want to use a server that is used in a production environment: IIS or Apache.  What you could do is install Wamp, test.  If it works, backup the Wamp PHP.ini file and copy the one in use by EW's server.  If it works again, then its the EW server, if it fails then its a PHP.INI setting which a simple file comarison should find.
    --
    Chris Hanscom - Microsoft MVP

    Get a Complete Website Analysis by Veign
    The trouble I've had with the XAMPP server is that the only way I know to use it is to edit the Apache configuration file to point to the directory of the source. That's OK for one site but I'm maintaining many sites and I don't want to edit the Apache server's ini file every time I change sites. Is there an easy way around that issue? 
    Monday, September 21, 2009 9:00 PM
  • Try the PHP newsgroup or mailing list:
    http://www.php.net/support.php

    This is a very strange problem.  I know I keep harping on this but what happens with Wamp?  Its time to start removing elements in an attempt to isolate the problem.

    --
    Chris Hanscom - Microsoft MVP
    On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help

    Get a Complete Website Analysis by Veign
    Monday, September 21, 2009 9:19 PM
  • "The trouble I've had with the XAMPP server is that ... "

    Nobody is talking about XAMP. I am familiar with it because the MySQL Essentials instructor for Lynda.com used it and demoed the installation, but it is not WAMP. Actually, the current version, AFAIK, is officially WAMPServer2. I installed it months ago; it probably comes with PHP 5.3.x now.

    You do not have to configure its Apache for every Web directory. Whatever you place in its default localhost root, c:\wamp\www\, will be addressable. So, c:\wamp\www\myTestSite\index.html is simply addressed http://localhost/myTestSite. C:\wamp\www\thisOtherSite\default.html is just http://localhost/thisOtherSite/.

    AFAIK, you can have more than one installation on a system; just don't fire up both servers at the same time (or Apache and IIS, for that matter ;-). Localhost could get real confused at that point. I really like WAMPServer2's system tray popup control center, which is fully-featured and very handy. And here's the point: Regardless of WAMPServer2's Apache server, you will have a different installation of php-cgi.exe to point EW's dev server toward, with a different php.ini. This should go a long way toward helping pin down your issue, capisci?

    cheers,
    scott
    Plural's don't have apostrophe's. It seem's sometime's that any word's ending in "s" get a gratuitous apostrophe. Apostrophe's are used to indicate possessive's and elision's (contraction's or abbreviation's).
    Monday, September 21, 2009 10:02 PM
  • I have installed WAMP 2.0 in default mode.

    What do I have to do to get EX3 to use PHP and Apache?

    Thanks

    - Bill
    Tuesday, September 22, 2009 3:18 AM
  • Before you do that (i.e. use Apache), you want to first test using the EW dev server, to determine if it will work with the php-cgi.exe/php.ini combination you just installed. If so, you're copacetic and need not even worry about using Apache unless you wish to.

    To do so, go into Tools|Application Options|General tab and enter the location of php-cgi.exe in the "Path to PHP executable... " box in the PHP section. For a default installation, that should be "C:\wamp\bin\php\php5.2.8\php-cgi.exe" (with whichever version of PHP was installed with the current WAMPServer2). For each site that will be using PHP, be sure that "Use the PHP executable set in the Application Options" is checked in the Site Settings Preview tab.

    Give it a try and let us know what happens.  ;-)

    cheers,
    scott

    Plural's don't have apostrophe's. It seem's sometime's that any word's ending in "s" get a gratuitous apostrophe. Apostrophe's are used to indicate possessive's and elision's (contraction's or abbreviation's).
    Tuesday, September 22, 2009 3:32 AM
  • I had in all the examples above used php.exe as the target for the development server. If I set the path to the php-cgi.exe then I get the following error:

    Server Error in '/' Application.

    HTTP Error 500 - Internal Server Error.



    Security Alert! The PHP CGI cannot be accessed directly.

    This PHP CGI binary was compiled with force-cgi-redirect enabled. This
    means that a page will only be served up if the REDIRECT_STATUS CGI variable is
    set, e.g. via an Apache Action directive.


    For more information as to why this behaviour exists, see the manual page for CGI security .


    For more information about changing this behaviour or re-enabling this webserver,
    consult the installation file that came with this distribution, or visit
    the manual page .





    Version Information:  Microsoft Expression Development Server 3.0.0.0
    Tuesday, September 22, 2009 3:44 AM
  • Ah, yes, I recall now. There's a single setting in the default php.ini file that needs to be changed to address that. Gimme a few minutes; it's been quite a few months. I'll get back to you...

    cheers,
    scott
    Plural's don't have apostrophe's. It seem's sometime's that any word's ending in "s" get a gratuitous apostrophe. Apostrophe's are used to indicate possessive's and elision's (contraction's or abbreviation's).
    Tuesday, September 22, 2009 3:53 AM
  • OK, thought I remembered this correctly. Use the WAMPServer control panel to open php.ini, then search for this section:

    ; cgi.force_redirect is necessary to provide security running PHP as a CGI under
    ; most web servers.  Left undefined, PHP turns this on by default.  You can
    ; turn it off here AT YOUR OWN RISK
    ; **You CAN safely turn this off for IIS, in fact, you MUST.**
    ; cgi.force_redirect = 1
     
    IIRC, it comes by default with the final line enabled (no leading semi-colon). Just add a semi-colon at the start of the line to disable it and save the file. I don't remember right off hand if it is necessary to shut down and restart the server (I don't think so, since you're not actually using the server from EW unless you explicitly decide to). In any event, it takes no time to do so if you wish.

    Give it a try and report back. I'm really curious to see if this is a dev server issue or something in the previous php configuration.

    cheers,
    scott
    Plural's don't have apostrophe's. It seem's sometime's that any word's ending in "s" get a gratuitous apostrophe. Apostrophe's are used to indicate possessive's and elision's (contraction's or abbreviation's).
    • Marked as answer by Time Bandit Monday, April 05, 2010 3:35 AM
    Tuesday, September 22, 2009 4:05 AM
  • Scott,

    Success!  Under windows 7, I had to first enable write permission for myself to be able to change a file in the "Program Files" directory but having done that I changed
    ;cgi.force_redirect = 1   =>  cgi.force_redirect = 0


    Now my test program does this:

    _SERVER["QUERY_STRING"]: happyness=hummerBeach
    _SERVER["REQUEST_URI"]: /word_passed_in_the_url_is.php?happyness=hummerBeach
    var_dump($_REQUEST): array(1) { ["happyness"]=> string(11) "hummerBeach" } 
    var_dump($_GET): array(1) { ["happyness"]=> string(11) "hummerBeach" }


    Oh, by the way, this is the php directly installed into the Program Files directory. I did load a copy of the WAMP which works so far as I can open it's splash page at http://localhost/index.php but how I get it to display one of my pages is still a mystery to me. Any tips on that front? NEVER MIND, I've got it figured out. Spent a little time reading the code in the WAMP splash page and realized it was going to list my projects for me if I just copied them into the c:/wamp/www directory. Cool. So it brings up a list of links to my web projects and I can click away and all the php code is working. Now I have to get all the database files loaded.

    Cheers

    • Edited by Time Bandit Tuesday, September 22, 2009 5:37 AM
    Tuesday, September 22, 2009 4:53 AM
  • Yee-ha!

    Allrighty, then. I guess we'll never know what the issue was with the other PHP installation. It might have been similarly an errant php.ini setting. Regardless, what we do know, at least with respect to this particular issue, is that EW's dev server works with PHP under Windows 7 beta, QED.  ;-)

    cheers,
    scott
    Plural's don't have apostrophe's. It seem's sometime's that any word's ending in "s" get a gratuitous apostrophe. Apostrophe's are used to indicate possessive's and elision's (contraction's or abbreviation's).
    Tuesday, September 22, 2009 5:02 AM
  • Scott,

    Success!  Under windows 7, I had to first enable write permission for myself to be able to change a file in the "Program Files" directory but having done that I changed
    ;cgi.force_redirect = 1   =>  cgi.force_redirect = 0


    Now my test program does this:

    _SERVER["QUERY_STRING"]: happyness=hummerBeach
    _SERVER["REQUEST_URI"]: /word_passed_in_the_url_is.php?happyness=hummerBeach
    var_dump($_REQUEST): array(1) { ["happyness"]=> string(11) "hummerBeach" } 
    var_dump($_GET): array(1) { ["happyness"]=> string(11) "hummerBeach" }


    Oh, by the way, this is the php directly installed into the Program Files directory. I did load a copy of the WAMP which works so far as I can open it's splash page at http://localhost/index.php but how I get it to display one of my pages is still a mystery to me. Any tips on that front? NEVER MIND, I've got it figured out. Spent a little time reading the code in the WAMP splash page and realized it was going to list my projects for me if I just copied them into the c:/wamp/www directory. Cool. So it brings up a list of links to my web projects and I can click away and all the php code is working. Now I have to get all the database files loaded.

    Cheers


    Sorry I caught this thread so late.  Here's a video on setting up PHP for EDS:
    http://expressionwebstepbystep.com/resources/?content=php-eds
    You'll see that immediately after installation I manipulate the /PHP folder's permissions to allow EDS to write to the PHP.ini file.

    Chris Leeds
    Join My Expression Studio SIG, I'll make it worth your while. ;-)
    Microsoft Press "Expression Web Step by Step"

    Tuesday, September 22, 2009 12:36 PM
  • Oh, by the way, this is the php directly installed into the Program Files directory. I did load a copy of the WAMP which works so far as I can open it's splash page at http://localhost/index.php but how I get it to display one of my pages is still a mystery to me. Any tips on that front? NEVER MIND, I've got it figured out. Spent a little time reading the code in the WAMP splash page and realized it was going to list my projects for me if I just copied them into the c:/wamp/www directory. Cool. So it brings up a list of links to my web projects and I can click away and all the php code is working. Now I have to get all the database files loaded.

    Cheers
    Program Files, eh? Hmm, I don't recall at this point if I changed the default installation or not. Mine is in c"\wamp\bin\. OTOH, they could have modified the setup since I installed it. Seems as if it's been about ten months or so, sometime around the end of last year, IIRC.

    Anyway, it appears that you're good to go now. You can access the MySQL console (if that's what you're using for databases) and phpmyadmin conveniently from the WAMPServer control panel. One of the things I like about WAMPServer is having that simple, convenient, centralized location to access most everything you'll need to work with in a WAMP environment.

    cheers,
    scott
    Plural's don't have apostrophe's. It seem's sometime's that any word's ending in "s" get a gratuitous apostrophe. Apostrophe's are used to indicate possessive's and elision's (contraction's or abbreviation's).
    Tuesday, September 22, 2009 3:14 PM
  • WAMP works for me, too.  There doesn't seem to be any substantial differences between the two php.ini files, though.  WAMP is using php-cgi.exe and I suspect that the EW server was using php.exe. That may have been the problem.

    Unfortunately, my EW3 trial has expired and, since I'm in Canada, I can't purchase a retail version yet.  Hence, I can't confirm my suspicion.  I'll just have to wait until MS deems Canadians worthy.

    Wednesday, September 23, 2009 1:07 PM
  • Thanks for all the work here. I ran into this issue -

    HTTP Error 500 - Internal Server Error.



    Security Alert! The PHP CGI cannot be accessed directly.

    ...and due to your great conversation I was able to solve my problem by modifying the PHP file from ";cgi.force_redirect = 1" to "cgi.force_redirect = 0"

    Thanks!!
    Tuesday, October 20, 2009 11:15 PM
  • Great! Thanks for the feedback. The forum Search feature comes through again!

    cheers,
    scott

    Plural's don't have apostrophe's. It seem's sometime's that any word's ending in "s" get a gratuitous apostrophe. Apostrophe's are used to indicate possessive's and elision's (contraction's or abbreviation's).
    Wednesday, October 21, 2009 2:24 AM
  • I have just reviewed this thread and have a similar prob. First, the link to the video given by Chris Leeds above is broken now, does anyone have a link to the video on setting up the development server in EW3 to work with PHP? Second, in going through a text on PHP5, a chapter has one set up a login page that uses a form to send input to a transaction page via php: the form action param is $_POST. The input sends the name etc to the transact page, where that page tests for input with <php if (isset($_REQUEST['action'])) {(do something)}  ... ?>I have added an echo("action set"); }else{echo("action not set");} to the if statement to test whether the data is sent. So far I have not been able to get the data to the transact page using EW3 and its Dev. Server, however the same page to page linkup works in DW with Apache as the testing or development server. I think that the EW3 dev. server may be the prob and need to set it up to work with php. I have done the install steps outlined in the EW help page referring to php and EW. Any suggestions?

    Saturday, April 03, 2010 10:29 PM
  • It's really much better practice to start your own thread rather than expect people to scan through 43 old posts to get to one you've tacked onto an old thread.

    Sunday, April 04, 2010 12:43 AM
  • When you set the method attribute of a <form> to "post" and set the action attribute to a PHP page, retrieve the posted form elements via the $_POST superglobal. In other words, if you have an <input> with the name of "myInputField," use $_POST['myInputField'] to retrieve that value.

    I've had no problems with the Express Web Development Server handling posted fields.


    Will
    Baltimore, MD USA - www.fastie.com
    Sunday, April 04, 2010 5:09 PM