Jump to content


Photo

Problem Running PHP Scripts


  • Please log in to reply
13 replies to this topic

#1 Opv

Opv
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 31 August 2006 - 10:15 PM

I just installed a web server on my home Windows XP laptop.  I am just testing out the feasibility of hosting my own permanent server.  I have downloaded and installed the latest version of PHP, Perl and MySql (latest as of today) and they all test and appear to be running.  I have assured that my web root matches in my web server and the PHP.ini file.

I have tested Perl scripts and CGI scripts and they seem to work fine.  And I can create a simple test PHP document and it runs fine.  PHPinfo() returns the expected results.  However, I have downloaded about 8 PHP scripts (guestbooks, etc) and followed the instructions by creating a folder within my web root and then loading the install.php file in my web browser.  My problem is that I can't get any of the php files to actually do anything.  I open the initial install.php file and click "install" and the page just sits there.  It's the same with every new php script I try to download and install. 

The author of one of the guestbook scripts suspects that it might be a problem with PHP not recognizing the _GET and _POST variables and referred me to a general PHP forum. 

Does anyone have any thoughts on what might be the problem?

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 31 August 2006 - 10:26 PM

can you tell me if you have tested the database as an install file only puts database information in a database then you delete it?

cheers redarrow.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 Opv

Opv
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 31 August 2006 - 10:48 PM

Bear in mind that I am new to PHP and MySql....I have tested MySql by creating a test database (simple script copied from the net) using my HTML/script editor, and it worked fine.  I haven't created the databases required by the PHP programs, as I wouldn't know where to start.  As best I can tell, the install.php scripts for the progrmas I have tried so far all ask for my MySql server, accessname and accesspassword, so I have presumed that they are designed to automatically create the required database. 

Thanks,

Opv

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 31 August 2006 - 10:58 PM

The install scipts should create the tables required for the PHP script to use however you will need to first create an empty database in order for these install scripts to add the required tables to the database. You can create a new database into MySQL using phpMyAdmin which is a web based MySQL database management script you can download for free from phpmyadmin.net

Could you provide the names of the scripts you are trying to install. Also which version of PHP do you have installed? And how did you install it.

#5 Opv

Opv
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 31 August 2006 - 11:09 PM

I installed PHP version 5.1.6 in C:\PHP and set the PATH in my environment variables to include the path to the PHP installation directory.  I then edited the PHP.ini (originally the recommended version) to set the doc_root path to match my web root path in my web server (BRS Webweaver).

I have downloaded the PHPJunkyard guestbook, the Vanilla guestbook, the Gbook and several others which I have since forgotten.  By the way, PHPMyAdmin is also one of the programs I have downloaded but which will not get past the first screen.  I experience the same problem in that program.

P.S.  FYI...I just created a main database and then tried to run one of the scripts but encounter the same problem.

#6 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 31 August 2006 - 11:25 PM

Do you get any errors? Also check that yoiu have error_reporting set to E_ALL and that display_errors is set to on. YOu can do this by opening the php.ini and finding the following:
; Print out errors (as a part of the output).  For production web sites,
Above that line should be the error_reporting directive. Change whats after the = sign to E_ALL

Now find the following a few lines down:
; server, your database schema or other information.
Below that line should be the display_errors directive, make sure On is stated after the equals sign.

Save the php.ini if any changes where made. Now restart your server. Do you get any errors displayed?

Also when you installed php did you enable the MySQL extension, as it is important you enable the this extension for any script to work if they use a MySQL database.

#7 Opv

Opv
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 01 September 2006 - 12:02 AM

OK, I have made the recommended changes to the Php.ini file.  The following are the extension settings:

; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
;extension=php_mbstring.dll
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
extension=php_mssql.dll
extension=php_msql.dll
extension=php_mysql.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll

I'm still experiencing the same problem after stopping and restarting my server.  I don't see any errors being reported on any screen.





#8 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 01 September 2006 - 12:14 AM

when you open the box for apache do you see that the words mysql on the box.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#9 Opv

Opv
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 01 September 2006 - 12:17 AM

I am not running Apache...I am using the BRS Webweaver server.  Here are some of the log entries:

HTTP Server Started - 31/Aug/2006:18:40:09
127.0.0.1 - - [31/Aug/2006:18:44:38] "GET /Gbook/gbook.php HTTP/1.1" 200 1651 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"
127.0.0.1 - - [31/Aug/2006:18:44:39] "GET /Gbook/style.css HTTP/1.1" 200 340 "http://localhost/Gbook/gbook.php" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"
127.0.0.1 - - [31/Aug/2006:18:44:39] "GET /Gbook/images/nospam.gif HTTP/1.1" 200 4301 "http://localhost/Gbook/gbook.php" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"
127.0.0.1 - - [31/Aug/2006:18:44:41] "GET /Gbook/gbook.php?a=sign HTTP/1.1" 200 1651 "http://localhost/Gbook/gbook.php" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"

#10 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 01 September 2006 - 12:18 AM

Did you make sure display errors is enabled? Also make sure PHP is actually using the php.ini by running the phpinfo() function. Look for the Configuration File (php.ini) Path row (4th row on the page that is generated). To the right of that it should state the path of the php.ini it is using, is this the correct path to the php.ini? If php cannot find the php.ini it'll say its in C:\WINDOWS\php.ini

Also I am unsure what you mean by 'same problem'. What is the problem?

To test that your GET and POST vars are running use this:
<?php

if(isset($_POST['submit']))
{
   echo "Welcome " . $_POST['name'] . "<br />\nPOST vars are working!<br />\n<br />\n";

   echo "Send this data via <a href=\"?name=" . $_POST['name'] . "\">GET</a>";
}
elseif(isset($_GET['name']))
{
    echo "Welcome " . $_GET['name'] . "<br />\nGET vars are working!";
}
else
{
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="Post">
  Name: <input type="text" name="name" /><br />
  <input type="submit" name="submit" value="POST Vars Test" />
</form>
<?php
}
?>
Fill in the name field, click the button does it return what you filled in? If does click the GET link. Does it return what you filled in the name form field?

#11 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 01 September 2006 - 12:26 AM

sorry wildteen i went to the users webserver website and heres the link the same question always comes up but becouse i got no user info for the forum i can not read the post here you go.

http://www.brswebwea...php?showforum=4

did you read this post
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#12 Opv

Opv
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 01 September 2006 - 12:30 AM

Yes, I changed the error reporting settings as recommended earlier.  The phpinfo() returns a full page or more of info, and the php.ini path is set correctly to c:\php. 

As for the "same problem", as I stated in my earlier posts, all of the php scripts do nothing after I load the original page, i.e., install.php (for the guestbooks) or the index.php (as in the case of phpmyadmin.php).  When I load those files, fill in the form fields, as applicable, and click on the link to proceed, the page just sits there as if I hadn't clicked on the link.  Nothing happens. 

On that note, the test script you provided did the same thing.  I type in my name and click "post vars test" and nothing happens.  I don't see a get button.

#13 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 01 September 2006 - 12:34 AM

This doesn't specifically sound like a php problem to me, maybe a server issue. Any particualr reason your using this brswebweaver? I would really recomend apache for php developement and testing.

#14 Opv

Opv
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 01 September 2006 - 01:08 AM

EUREKA.  Thanks.  I found the problem.  I had already checked the BRS Webweaver site and searched the forum but failed to find the solution.  It was there all the time. Thanks for helping me find it.  The solution is that I had to tell my web server to point to php_cgi.exe rather than php.exe.  I made that change, restarted my server and it works fine. 

Thanks everyone for your help.

Opv




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users