Using Brackets and MAMP to preview php file - php

I need help to preview my php file. I've been trying for days now and can't get it to work. My apache and mySQL servers are both connecting.
I've set up my Brackets and it did open up a preview screen in Chrome but whatever i have in the file just won't show up.
Please help me out, thanks!
Angel

From here, it appears that you're probably getting a silent PHP parse error, you can check the PHP log in MAMP to confirm.
The standard PHO opening tag is
Give this a try:
<?php
echo "Hello world";
?>

Related

Unable to execute some php files on MAMP & WAMP

I'm sorry in advance for being a noob
So I started taking a php course the instructor told viewers to install mamp or xammp
A quick google search said Wamp is better for windows so I went along with it, the problem I faced was that the php files I created were not being executed whereas the professor's php web application worked perfectly, I did everything correctly. I created a text doc replaced txt with php extension and then wrote a simple code
<?php> echo "hello world" ?>
This was not being executed, the server kept saying unable to handle this request.
So I uninstalled wamp and installed mamp, I deleted the original files from httdocs which were a simple index.php and jpg file.. I pasted two folders, one my professor's web application and the second being my practice lab. And again it displayed the same regardless of the fact that I'm opening the file through the index directory
I don't know what's the error. Can anyone help me?
I am trying to get this run for almost 3 hours
As per the comments above...
Seems like it could be a 500 internal server error. Try <?php echo "Hello world"; ?>
500 internal server errors are shown when your php code has fatal errors that can't be processed.
Your error come from opening and closing tag.
Based on PSR-1
It should be <?php and ?> but not <?php>
PHP code MUST use the long <?php ?> tags or the short-echo <?= ?>
tags; it MUST NOT use the other tag variations.

How can I fix the error "Expected tag name, got “?” instead! (Html doesn’t support processing instructions)" in PHP? (I'm using CodeTasty.com)

I'm making a website for school on CodeTasty.com. Everytime I use <?php ?> I get the following error:
"Expected tag name, got “?” instead! (Html doesn’t support processing instructions)"
The PHP code is also not executed.
I don't think it's because the code is wrong, for I still get the error with code copied from the internet.
Does anyone know how to fix this? Thank you!
If the webserver supports php, change the file extension to .php instead of .html.
If the webserver does not support php, find a webserver that does, or use inline javascript if possible.

Error using PHP code in Aptana

I am trying to add just a simple hello world type of PHP code using Aptana 3.0. The editor is giving me an error. I have looked at several examples of PHP code on the internet and I am not sure what the editor does not like. Here is the sample code.
<?php
echo "Hello World!";
?>
The Aptana editor gives me the following error.
"' for end of tag
I am not sure what to make of it. I am probably missing something simple but I am not sure what it is. Thanks.
It looks like you are inserting PHP code in a file whose type is not PHP or editing a .php file with a wrong editor.
Check that it's a PHP file and/or right-click on your file and select "Open With" -> "Other ..." -> "PHP Source Editor".

PHP error don't display on Opensuse 11 Firefox

On opensuse 11, Firefox isn't displaying php errors. For exemple, I have correct.php and broken.php :
correct.php
<?php echo("test"); ?>
broken.php
<?php echo("toto ?>
Loading correct.php, displaying "test"
Loading broken.php, displaying "test" again
In fact, the loaded page seems the same.
I tried on Windows 7 Firefox and it's showing :
PHP Parse error: syntax error...
My PC is on Opensuse, I borrowed the Windows one to test this thing...
And I don't have access to the server (only a ftp on a sub-folder of the website)
Thanks a lot if you help me, if you don't thanks anyway cause stackoverflow's helping me a lot (even without asking 8D )
edit : If I'm going to broken.php with a link (), the URL isn't changing on OpenSuse FF, on Windows FF it's going to the page with the php error
at the php.ini check if the display_error = on
if not change it to on then restart the web server
then try again
Try putting this at the top of your file:
error_reporting(E_ALL);

Komodo edit syntax highlightening

I just installed Active state's komodo edit on my Windows. It's running fine but unable to detect syntax errors in php file. Like this code
<?php>
phpinfo() foo[] is my name
?>
There must be a red error highlighted line beneath the error.
Any idea?
Should help you this forum thread?
http://community.activestate.com/forum/php-syntax-checking-komodo

Categories