Pages: 1234Next
Current Page: 1 of 4
cant view .php files
Posted by: teknikalcrysis (---.dsl.covlil.sbcglobal.net)
Date: May 15, 2010 04:43AM

Okay I installed wampserver 2.0
everything works great... i can access phpmyadmin and i can view the localhost index

i installed a php script into the www directory

i can view the directory [localhost]
but when I try to access a .php file within that directory [localhost]
nothing comes up
it either tells me, connection was reset
or
unable to connect

i have my router config'd to port forward to correct pc, and port 80 open on the pc running wamp

why cant i access the php script file?

Options: ReplyQuote
Re: cant view .php files
Posted by: yfastud (Moderator)
Date: May 15, 2010 02:38PM


Options: ReplyQuote
Re: cant view .php files
Posted by: teknikalcrysis (---.dsl.covlil.sbcglobal.net)
Date: May 15, 2010 08:11PM

yfastud Wrote:
-------------------------------------------------------
> to setup website w/ wamp, follow this
> [blog.jlbn.net]


seen that, read that, and that didnt help

I have a \stage\ folder in the www directory ...inside the stage folder is setlive.php

setlive.php doesnt open no matter where I put it in www ...root or subdirectory, its just does work.... I know there is nothing wrong with the script, because when I upload it to a domain I have hosted at 1and1.com the script works perfect, it access my sql DB and everything.... just doesnt work when I try and use it with wamp

Options: ReplyQuote
Re: cant view .php files
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: May 15, 2010 08:39PM

u have <? ?> tags ?

u need <?php ?>

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: cant view .php files
Posted by: teknikalcrysis (---.dsl.covlil.sbcglobal.net)
Date: May 16, 2010 01:04AM

stevenmartin99 Wrote:
-------------------------------------------------------
> u have <? ?> tags ?
>
> u need <?php ?>


they are <?php tags

Options: ReplyQuote
Re: cant view .php files
Posted by: yfastud (Moderator)
Date: May 16, 2010 06:30AM

did you setup db acct for that script???

to setup db acct, follow this
[blog.jlbn.net]

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: cant view .php files
Posted by: teknikalcrysis (---.dsl.covlil.sbcglobal.net)
Date: May 17, 2010 12:36AM

yes... i have a database setup.... when I put the .php file on teknikalcrysis.com it works perfectly... it accesses the data base on my LOCAL PC... but when I use the php file LOCALLY from the www folder I get connection error... so I know for sure that it is NOT an SQL problem because the same php file accesses my local network SQL database when I move the php file to a remote host... but that file doesnt work when I have it local

Options: ReplyQuote
Re: cant view .php files
Posted by: yfastud (Moderator)
Date: May 17, 2010 06:05AM

a lot of php scripts, such as wordpress, based on the url that used to install to reroute all paths; thus, you can NOT simply copy the whole folder from live host to wamp/www folder on your pc and hope it work, but have to reinstall that script w/ new db, then import db data backuped from live host

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: cant view .php files
Posted by: teknikalcrysis (---.dsl.covlil.sbcglobal.net)
Date: May 19, 2010 12:08AM

okay i guess I need to be more specific...

i have the source php script.... this script does not have nor does it need an install.php ... it just simply needs to be edited to access a SQL database.......the MySQL database that this script uses is stored on my OWN pc, using the SQL database provided with WAMPSERVER

the php script is config'd to access the SQL Database on my pc... if I put the setlive.php script ANYWHERE with in the www folder provided by WAMP ( say for example - www\stage\setlive.php ) and then I use my browser to navigate to [localhost] ...all I get is a connect reset error page ....when I got to [localhost] ...I can see the WAMP Info page ...and can even view the phpinfo script ... but for some reason the setlive.php script doesnt work when I host it locally ... okay, now I have a domain, teknikalcrysis.com ..that I do NOT host, it is provided by 1and1 hosting that I pay for... if I take the same setlive.php script and put it ANYWHERE on teknikalcrysis.com ( Say for example - teknikalcrysis.com/stage/setlive.php ) WITHOUT CHANGING ANY CONFIG SETTING, meaning this same setlive.php file is STILL ACCESSING THE SQL DATABASE ON MY LOCAL MACHINE provided by WAMP and then Navigate to teknikalcrysis.com/stage/setlive.php
the script works perfectly ...it give me a textbox to type the title of the DJ's show and a button that says GO LIVE ... after the title is set and the button is pressed ...the php script logs in to my LOCAL SQL DATABASE and CORRECTLY inputs the information into my LOCAL SQL database just like it is supposed to do

my question is, if I have the source file, and my database info within that file is correct (which i know it is)
why when uploading the php file to my teknikalcrysis.com domain does the file show up on my screen, and when used locally, get a connection error

here is the code from the setlive.php file

****I have removed potential login info for security reasons...
*** teknikalcrysis.kicks-ass.net is a DynDNS routed to my local pc hosting WAMP and my SAM Broadcaster for my radio stream

<?php

$dbhost='teknikalcrysis.kicks-ass.net'; // Sams MySQL ip or host address
$dbuser='USERNAME-HERE'; // Sams MySQL username
$dbpass='PASSWORD-HERE'; // Sams MySQL password
$dbnamesam='SAMDB'; // Sams MySQL database name
...
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"[www.w3.org];
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="admin.css" rel="stylesheet" type="text/css">
<title>Live DJ Request</title>

<link href="admin.css" rel="stylesheet" type="text/css">

<body>
<center>
<?php
...
mysql_connect($dbhost,$dbuser,$dbpass) OR DIE ('Unable to connect to database! Please try again later.');
mysql_select_db($dbnamesam) or die( "Unable to select database"winking smiley;
...
?>
...

</body>
</html>

now I have tried to change the $timeout and this has no effect



Edited 2 time(s). Last edit at 05/19/2010 01:54AM by yfastud.

Options: ReplyQuote
Re: cant view .php files
Posted by: yfastud (Moderator)
Date: May 19, 2010 01:57AM

as mentioned above, DID you setup db acct in wamp for this script??? if yes and if you follow my guide, the info should be:
$dbhost='localhost'; // Sams MySQL ip or host address
$dbuser='SAMDB'; // Sams MySQL username
$dbpass='PASSWORD-HERE'; // Sams MySQL password
$dbnamesam='SAMDB'; // Sams MySQL database name

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: cant view .php files
Posted by: teknikalcrysis (---.dsl.covlil.sbcglobal.net)
Date: May 19, 2010 02:17AM

yes I have a SQL db setup... but I am using the root login... and Sam Broadcaster is reading the DB...as SAM is the only application accessing the database



Edited 1 time(s). Last edit at 05/19/2010 02:21AM by teknikalcrysis.

Options: ReplyQuote
Re: cant view .php files
Posted by: borainc (203.117.221.---)
Date: May 19, 2010 11:04AM

I have the same problem.

yfastup: why you keep asking database setup? he simply tells that apache is not processing php before sending client.

Options: ReplyQuote
Re: cant view .php files
Posted by: yfastud (Moderator)
Date: May 19, 2010 06:50PM

unless your mysql does not run which results yellow wamp tray icon, you most likely did not setup db acct properly, and instead wasting time to correct your current db, you should simply setup new db acct based on my guide to try it out then from there to figure out what wrong w/ your db winking smiley

to setup db acct, follow this
[blog.jlbn.net]

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: cant view .php files
Posted by: teknikalcrysis (---.dsl.covlil.sbcglobal.net)
Date: May 20, 2010 12:11AM

grrrr.... i dont need to setup a new database.... there is nothing wrong with the one I have... because as I said, when I use the PHP script, and the PHP script alone, on my remotely hosted domain it uses the SQL database on my PC that I have LOCALLY provided by WAMP... and the file CORRECTLY USES THE DATABASE ( I dont know how many times I have to say that! )

I am not an idiot when it come to this.... I completely designed and coded my own website @ teknikalcrysis.com, everything from top to bottom! And I know I am not the most skilled when I come to this kind of stuff, but again I stress that I am no dummy when it comes to knowing how to correctly setup a database in SQL or coding HTML, now PHP is slightly new to me, but I still think I know enough to do what I need to do....

Now I know I have said this before as well.... THERE IS NOTHING WRONG WITH THE SQL DATABASE... it must be a setting inside APACHE provided by WAMP that has something to do with why I cant load a php script within WAMP locally

I am familiar with APACHE but new to WAMP.. I just think I dont have something ticked or checked right..

If I wasnt worried about security issues, I'd give you access to my LOCAL SQL DATABASE provide by WAMP just to show that this is not a db issue, but thats not going to happen...

so please dont tell me a forth time to setup a database, cuz even though I dont know the cause of this issue, I know it doesnt have anything to do with my local SQL...

Options: ReplyQuote
Re: cant view .php files
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: May 20, 2010 07:24AM

can i ask? how did you get the file onto your pc?


if you copied made it in notepad then the chances are the file is actually called setlive.php.txt

and windows is set to hide Known file types - ul know this if you look at JPGS.. ETC - is .jpg shown at the end?


anyway to turn it off - control panel> folder options>view tab(where shown hidden files is)>

and UNTICK the box that says - HIDE FILE EXTENTIONS FOR KNOWN FILE TYPES.


Now see of your file shows a .php.txt extention and fix it.
-------------------------------------------------------------

in notepad when saving a file you can chnage the file type to ALL FILES- so it doesnt add the .txt extention

or download Notepad++

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: cant view .php files
Posted by: bondies (---.dyn.iinet.net.au)
Date: May 20, 2010 09:19AM

Sounds like either the max download variable is too low OR security software (firewall or anti-virus) is causing an issue, I'd disable your security sofware try it again. If still have the same issue then look at the download variables.

Options: ReplyQuote
Re: cant view .php files
Posted by: teknikalcrysis (---.dsl.covlil.sbcglobal.net)
Date: May 20, 2010 02:52PM

the file is correctly named setlive.php with no .txt extension ...
the source file was downloaded, not copied and pasted...

and as for the security/firewall software... I have it config'd to allow the appropriate ports, and have even tried shutting it completely off with no luck as to getting the script to load....
I went back and 'ticked' on a whole bunch of php settings and extensions as well as ticking on some more settings and extensions in apache, provided by WAMP

and tried to load the scripts again, and once got a page I had never seen when trying to load the script...
something about a constant Y on line 81
and a timeout error... so I increased the $timeout variable again....and then tried to refresh the script and got a connection error again

Options: ReplyQuote
Re: cant view .php files
Posted by: teknikalcrysis (---.dsl.covlil.sbcglobal.net)
Date: May 21, 2010 08:08AM

i believe I have the download max set @ 8M

Options: ReplyQuote
Re: cant view .php files
Posted by: LazyDaisy (---.range81-129.btcentralplus.com)
Date: May 21, 2010 07:33PM

Hi Tek...

I'm adding a quick edit at the top...smiling smiley

BIG question...is your Server live- as in ONLINE?

Not sure if you copied your html DOC Type declaration correctly, or if you just rough copied it, as there is an error in the declaration you have there. It's the correct DOC type BUT it's just missing some vital parts which may or may not have something to do with your problem. Better to fix it if that's what you have on your original file.

Reading all of this discussion, it looks to me like a wind up...but it could be you are having a genuine problem. I must admit, I was wondering if you have set the DB correctly...at least got the right permissions in place. I've had problems like this happen when I'm working ahead of myself, and miss those little things like the DOC type declaration I mentioned at the start.

Just take some time and go over your php your html your mysql and then try again. I bet it's one of these that's at fault.

Peace smiling smiley

LazyDaisy



Edited 1 time(s). Last edit at 05/21/2010 07:36PM by LazyDaisy.

Options: ReplyQuote
Re: cant view .php files
Posted by: teknikalcrysis (---.dsl.covlil.sbcglobal.net)
Date: May 21, 2010 09:33PM

yes the server is online lol... what is missing in the DOC type? I downloaded the php file and edited the correc db info

Options: ReplyQuote
Pages: 1234Next
Current Page: 1 of 4


Sorry, only registered users may post in this forum.