www.webdeveloper.com
Results 1 to 5 of 5

Thread: php not working

  1. #1
    Join Date
    Apr 2013
    Posts
    73

    php not working

    Hello,
    I know from following many posts that some one here will readily
    see the solution to my problem for PHP not working. In Xampp Both the apache
    and mysql show "running" and Phpmyadmin status displays this:
    Component
    Status
    Hint
    MySQL database ACTIVATED
    PHP ACTIVATED
    HTTPS (SSL) ACTIVATED
    Common Gateway Interface (CGI) DEACTIVATED
    Server Side Includes (SSI) ACTIVATED
    Tomcat Service DEACTIVATED
    PHP Code:
    <?php
    // error_reporting(0);
    error_reporting(E_ALL E_NOTICE); 
    mysql_connect('localhost','root',' ');
    mysql_select_db('test') or die("Unable to select database");
    $query="SELECT * FROM testable Where id='$id'";
    $result=mysql_query($query);
    $num=mysql_numrows($result);
    echo 
    date("m/d/Y") . "<br />";
    echo 
    "<font size=+2><b> test<br /><br />";
    echo 
    "<table cellspacing=1 cellpadding=0 border=0>
            <tr>
        <TH>target</TH>
        
        <tr>
        <TH>=======================================================================</TH>
        </tr>"
    ;
    while(
    $row mysql_fetch_array($result))
    {
    echo 
    "<tr>";
    echo 
    "<td>" $row['target'] . "</td>";
    echo 
    "</tr>";
    echo 
    "</table>";
    mysql_close();
    ?>
    this is the result from the little php execution:
    "; echo " test
    "; echo ""; while($row = mysql_fetch_array($result)) { echo ""; echo ""; echo ""; echo "
    target
    =========================
    " . $row['target'] . "
    "; mysql_close(); ?>
    php error log:
    PHP Warning: file_get_contents(lang.tmp): failed to open stream: No such file or directory in C:\xampp\htdocs\xampp\index.php on line 2.
    C:\xampp\htdocs\xampp\index.php does include lang.tmp,
    C:\xampp\htdocs\xampp contains the languages.

    mysql error log:

    130705 17:05:09 InnoDB: The InnoDB memory heap is disabled
    130705 17:05:09 InnoDB: Mutexes and rw_locks use Windows interlocked functions
    130705 17:05:09 InnoDB: Compressed tables use zlib 1.2.3
    130705 17:05:09 InnoDB: Initializing buffer pool, size = 16.0M
    130705 17:05:09 InnoDB: Completed initialization of buffer pool
    130705 17:05:09 InnoDB: highest supported file format is Barracuda.
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    130705 17:05:09 InnoDB: Database was not shut down normally!
    InnoDB: Starting crash recovery.
    InnoDB: Reading tablespace information from the .ibd files...
    InnoDB: Restoring possible half-written data pages from the doublewrite
    InnoDB: buffer...
    130705 17:05:10 InnoDB: Waiting for the background threads to start
    130705 17:05:11 InnoDB: 5.5.32 started; log sequence number 1615965
    130705 17:05:11 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
    130705 17:05:11 [Note] - '127.0.0.1' resolves to '127.0.0.1';
    130705 17:05:11 [Note] Server socket created on IP: '127.0.0.1'.
    130705 17:05:11 [Note] Event Scheduler: Loaded 0 events
    130705 17:05:11 [Note] c:\xampp\mysql\bin\mysqld.exe: ready for connections.
    Version: '5.5.32' socket: '' port: 3306 MySQL Community Server (GPL)
    apache error log:

    [Fri Jul 05 17:05:13.237543 2013] [core:notice] [pid 5488:tid 376] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
    [Fri Jul 05 17:05:13.253143 2013] [mpm_winnt:notice] [pid 5488:tid 376] AH00418: Parent: Created child process 5224
    [Fri Jul 05 17:05:16.700749 2013] [ssl:warn] [pid 5224:tid 388] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
    [Fri Jul 05 17:05:18.245152 2013] [ssl:warn] [pid 5224:tid 388] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
    [Fri Jul 05 17:05:18.541552 2013] [mpm_winnt:notice] [pid 5224:tid 388] AH00354: Child: Starting 150 worker threads.
    [Fri Jul 05 17:07:21.544196 2013] [cgi:error] [pid 5224:tid 1816] (OS 2)The system cannot find the file specified. : [client 127.0.0.1:63141] couldn't create child process: 720002: cgi.cgi
    [Fri Jul 05 17:07:21.544196 2013] [cgi:error] [pid 5224:tid 1816] (OS 2)The system cannot find the file specified. : [client 127.0.0.1:63141] AH01223: couldn't spawn child process: C:/xampp/cgi-bin/cgi.cgi
    [Fri Jul 05 20:38:15.201741 2013] [cgi:error] [pid 5224:tid 1840] (OS 2)The system cannot find the file specified. : [client 127.0.0.1:64234] couldn't create child process: 720002: cgi.cgi
    [Fri Jul 05 20:38:15.201741 2013] [cgi:error] [pid 5224:tid 1840] (OS 2)The system cannot find the file specified. : [client 127.0.0.1:64234] AH01223: couldn't spawn child process: C:/xampp/cgi-bin/cgi.cgi
    apache access log:

    127.0.0.1/phpmyadmin/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0"
    127.0.0.1 - - [05/Jul/2013:20:47:05 -0400] "GET /phpmyadmin/index.php?ajax_request=1&recent_table=1&token=46df29126b6c8062a5084425ebd52283 HTTP/1.1" 200 1394 "http://127.0.0.1/phpmyadmin/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0"
    127.0.0.1 - - [05/Jul/2013:20:47:46 -0400] "GET /phpmyadmin/db_structure.php?server=1&db=test&token=46df29126b6c8062a5084425ebd52283&ajax_request=true&ajax_page _request=true&menuHashes=0574ecaa-5896f635-1befd9a5-2c296635-c10c23d7-3d90bcb7-3b625548&_nocache=1373071666762691238 HTTP/1.1" 200 9148 "http://127.0.0.1/phpmyadmin/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0"
    127.0.0.1 - - [05/Jul/2013:20:47:58 -0400] "GET /phpmyadmin/sql.php?db=test&token=46df29126b6c8062a5084425ebd52283&goto=db_structure.php&table=testable&pos=0&aj ax_request=true&ajax_page_request=true&menuHashes=0574ecaa-5896f635-1befd9a5-2c296635-c10c23d7-3d90bcb7-3b625548&_nocache=1373071678786214667 HTTP/1.1" 200 24873 "http://127.0.0.1/phpmyadmin/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0"
    127.0.0.1 - - [05/Jul/2013:20:47:59 -0400] "GET /phpmyadmin/themes/pmahomme/img/s_fulltext.png HTTP/1.1" 200 193 "http://127.0.0.1/phpmyadmin/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0"
    127.0.0.1 - - [05/Jul/2013:20:47:59 -0400] "GET /phpmyadmin/js/get_scripts.js.php?scripts[]=tbl_structure.js HTTP/1.1" 200 7496 "http://127.0.0.1/phpmyadmin/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0"
    127.0.0.1 - - [05/Jul/2013:20:47:59 -0400] "GET /phpmyadmin/themes/pmahomme/img/col_drop.png HTTP/1.1" 200 132 "http://127.0.0.1/phpmyadmin/phpmyadmin.css.php?server=1&lang=en&collation_connection=utf8_general_ci&token=46df29126b6c8062a5084 425ebd52283&nocache=5488863109ltr" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0"
    127.0.0.1 - - [05/Jul/2013:20:47:59 -0400] "GET /phpmyadmin/themes/pmahomme/img/col_pointer.png HTTP/1.1" 200 113 "http://127.0.0.1/phpmyadmin/phpmyadmin.css.php?server=1&lang=en&collation_connection=utf8_general_ci&token=46df29126b6c8062a5084 425ebd52283&nocache=5488863109ltr" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0"
    127.0.0.1 - - [05/Jul/2013:20:47:59 -0400] "GET /phpmyadmin/index.php?ajax_request=1&recent_table=1&token=46df29126b6c8062a5084425ebd52283 HTTP/1.1" 200 1394 "http://127.0.0.1/phpmyadmin/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0"

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,314
    "; echo " test
    "; echo ""; while($row = mysql_fetch_array($result)) { echo ""; echo ""; echo ""; echo "
    target
    =========================
    " . $row['target'] . "
    "; mysql_close(); ?>
    That would seem to be indicating that the code you posted is not being parsed/executed as PHP. If you are running it locally on your PC, make sure you are accessing it via a "localhost" domain, e.g.: "http://localhost/index.php" (as opposed to something like "file:///C:/xampp/htdocx/index.php").
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Apr 2013
    Posts
    73
    Quote Originally Posted by NogDog View Post
    That would seem to be indicating that the code you posted is not being parsed/executed as PHP. If you are running it locally on your PC, make sure you are accessing it via a "localhost" domain, e.g.: "http://localhost/index.php" (as opposed to something like "file:///C:/xampp/htdocx/index.php").
    I want you to know how grateful I am for your response, I hadn't considered that.
    Please tell me, what brought you to your conclusion? It may be the clue to redirect my thought.

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,314
    What brought it to mind is that it has happened at least once to nearly everyone who has ever worked with PHP on their local computer.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  5. #5
    Join Date
    Apr 2013
    Posts
    73
    Right. I figured it might be the topic or the first line of my post. Again, thanks.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles