Claite Posted February 1, 2009 Share Posted February 1, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/143331-solved-php-problems-with-echo/ Share on other sites More sharing options...
Philip Posted February 1, 2009 Share Posted February 1, 2009 Make sure you are visiting the page via a browser & http://localhost/ - and not just trying to open the page by double clicking the file. Quote Link to comment https://forums.phpfreaks.com/topic/143331-solved-php-problems-with-echo/#findComment-751746 Share on other sites More sharing options...
Claite Posted February 1, 2009 Author Share Posted February 1, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/143331-solved-php-problems-with-echo/#findComment-751758 Share on other sites More sharing options...
Philip Posted February 1, 2009 Share Posted February 1, 2009 In order for wamp to process it, it must be in the www folder. You are able to specify where it is in one of the settings, but it's been so long since I've had to change that, I'd recommend just googling it. Quote Link to comment https://forums.phpfreaks.com/topic/143331-solved-php-problems-with-echo/#findComment-751761 Share on other sites More sharing options...
Claite Posted February 1, 2009 Author Share Posted February 1, 2009 Thank you so much for your help! I love it when stuff actually.... works Quote Link to comment https://forums.phpfreaks.com/topic/143331-solved-php-problems-with-echo/#findComment-751775 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.