Jump to content

[SOLVED] WAMP displaying php code


Recommended Posts

hello.... im only learning php (working through some tutorials and looking at other peoples scripts)

i have just installed and configured WAMP with the passwords need and everyhing is working fine apart from when i try and view php scripts.

 

the scripts run fine in my php enabled website one looks like this

php%20frpm%20internet.png

 

but when i run the same script in wamp i get this

php%20from%20wamp.png

 

please help

this is really making things hard to learn and not very enjoyable

 

Thanks heaps

Martin

Link to comment
Share on other sites

yes it does use the short tags <?

i went through and changed all the short tags to long tags on all the php scripts (gotta love find and replace  :D)

 

i ran it again and got

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'your_name'@'localhost' (using password: YES) in G:\~~WEBSERVER~~\wamp\www\martin.site11.com\include\database.php on line 24

Access denied for user 'your_name'@'localhost' (using password: YES)

 

i had a look over line 24 of the database script and could find nothing that i would need to change to allow access (after all so far all i have changed is <? to <?php)

here is the code that is having the access issue

wamp%20access%20error.PNG

 

so now i have another error that i dont know how to deal with

Link to comment
Share on other sites

Assuming the code is unchanged from the live server I imagine the password/hostname/username is different on your localhost than it is on your live server. Somewhere in your code you will probably have define('DB_SERVER', "something"); etc for each of server, user, password and database name. These will all need changing to be appropriate for your WAMP server.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.