Jump to content

Recommended Posts

I tried a search, and couldn't find anything related so I apologize if it has been already asked.

 

I'm having very basic issues with PHP, which leaves me baffled. I installed Wamp server v. 2.0 with PHP, Apache, and MySQL. I'm running Windows vista Home basic 32 bit, and customarily use Firefox to run my pages.

 

I'm still learning, so I was trying a login script that communicates with a MySQL database and writes in information (like a username and a password). When I started getting issues with it not writing, I tried a few echos to see what's up. That's when I found the problem. Nothing was echoing.

 

I tried opening a new notepad file and simply wrote:

 

<?php

echo "Hello World";

?>

 

I tried also Hello World and 'Hello World'. Nothing is being printed. The page comes up blank. What's weird is that if I go to localhost on my browser, it comes up with the wamp page, and if I click the phpinfo() on there, it works. But if i wrote phpinfo(); in my code, still blank. Wamp is fully white, I've tried restarting and refreshing and wamp comes back online with all services running.

 

Does anyone know the issue? I'm wondering if my computer isn't even processing PHP being installed on my computer... I feel bad that echo is the most basic function, and I can't even get that to work :'(

 

Thanks in advance for all your help! If I wasn't clear, please ask. I really want to start learning/using PHP but if I can't even run it on my computer...

 

Claite

Link to comment
https://forums.phpfreaks.com/topic/143331-solved-php-problems-with-echo/
Share on other sites

So, if I add the file into the www directory under my own folder and run through localhost, it works. Thank you for that.

 

But is there any way to allow a .php file opened from anywhere on the computer to be executed as such and run as PHP? Or will all my files and projects have to be within the wamp/www folder?

 

I figure if not, then I'll just do all my stuff in that folder and be done with it :D

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.