PHP Include not working with WAMP
Posted by: JackStyles (---.ok.ok.cox.net)
Date: May 29, 2008 08:24AM

I have a script that works on my Live Server on the Web, the only problem I am having is when I run it with WAMP I get a
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in

Error when trying to make a connection to the database. I spent a few hours making sure everything in my code was correct, and that it wasn't because I was trying to upgrade to PHP 5.2.6 (Tried the one I am using on the webserver as well)

Now I troubleshot everything down and figured out that it's either not accepting my Include files, or it's not bringing over the Variable for the Database Connection.

Instead of "Including" the files with the Database connection I just pulled over the connection variables and mysql_connect queries, And it works for that page (but obviously none of the others that are using the same config.php file)

Is there something I am missing to turn on the allowing of Includes through WAMP?

I am using the newest version, Wampserver 2.0c.

Thanks in advance for any help.

Options: ReplyQuote
Re: PHP Include not working with WAMP
Posted by: twohawks (---.lax.dsl-w.verizon.net)
Date: May 29, 2008 09:17AM

Hi Jack,
Shorttags issue maybe? (Just google it if you don't know). Just a possibility/thought.

I am a bit tired right now, but to mention... I ran into an issue regarding handling relative paths in the include 'links' (and using the SERVER('DOCUMENT_ROOT') variable and some trying issues with relative paths).
After going 'round all the houses' I finally learned that there are different considerations need to be taken into account if "php has been installed as an apache module", or not, etc.
If memory serves, I think there's some input on this at php.net (the manual) under 'virtual(), the 'other' include statement. Worth a look.
While your at it, try testing using an absolute URI for the include... not recommended for deployment, but if that works then you know there is an issue with include syntax and relative path handling.

Hope this helps.
Cheers,
TwoHawks

Love is the Function, No Form is the Tool.

Options: ReplyQuote
Re: PHP Include not working with WAMP
Posted by: JackStyles (---.ok.ok.cox.net)
Date: May 29, 2008 09:26AM

Hey thanks, I didn't even think to look to turn on short open tags. smiling smiley Thanks.



Edited 1 time(s). Last edit at 05/29/2008 09:26AM by JackStyles.

Options: ReplyQuote
Re: PHP Include not working with WAMP
Posted by: JackStyles (---.ok.ok.cox.net)
Date: May 29, 2008 09:38AM

And now to go through and remove them. smiling smiley

Options: ReplyQuote
Re: PHP Include not working with WAMP
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: May 29, 2008 03:57PM

or u can tuen on short tags! in the php setting

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

Options: ReplyQuote
Re: PHP Include not working with WAMP
Posted by: twohawks (---.lax.dsl-w.verizon.net)
Date: May 29, 2008 11:01PM

I turned my on in htaccess for my pre-existing sites... until I aboslutely need to do the old search/replace/test shuffle ;^)

Love is the Function, No Form is the Tool.

Options: ReplyQuote


Sorry, only registered users may post in this forum.