I tried to execute a php code using Wamp Server and PHP 5. it didn't work with me properly. When i executed it All times the php code content itself is coming not the things we expect. I tried with NetBeans IDE too. It returned as Connection Failed. How to run a php file other than these ways? Pls do help me.

Recommended Answers

If you see the php code when you try to execute the module then the most likely cause is that you didn't save the module with a .php suffix. If that is the case, change the suffix and try again.

Jump to Post

I would try to run the file on a test server/folder.

Jump to Post

All 5 Replies

If you see the php code when you try to execute the module then the most likely cause is that you didn't save the module with a .php suffix. If that is the case, change the suffix and try again.

the problem might be that if u r saving ur prjt.....it is saving in .txt format...
means the extention is .txt...
just change into .php
and for netbeans u have to use apache server.....it is not their in netbeans...just install xampp server and run apache server....it will work fine....

Save your file in root directory wamp/www/ the extension .PHP(filename.php)

I would try to run the file on a test server/folder.

If you have wamp installed you can run php from the command line.
In my system it's c: \xampp\php\php <filename.php> You won't have any server variables or HTTP properties like cookies, though.

If you can run it that way but not under apache, then probably apache is not configured correctly. Check your apache config for a line like AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml .phpt

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.