Error using PHP code in Aptana - php

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".

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.

PhpStorm debug console says "this view is read only"

I have xdebug stop in one breakpoint and I want to test some code in console but I have a problem.
I can't write in console and when I tried to paste it says "this view is read only"
I had the same issue with log files. Disabling all log highlight plugins (i.e. Ideolog) fixed it. They weren't highlighting anything anyway except scrollbar in green color.
Hope this helps somebody.
Sometimes this can happen for the log file that is too large. PhpStorm disables the possibility of editing it and adds “this view is read only” message.
If I'm reading your screenshot and what you wish to do correctly ... then PhpStorm version you are using is too old.
The Interactive Debug Console was added in v10 while you are using v9.0.2.
https://blog.jetbrains.com/phpstorm/2015/09/get-an-advantages-of-interactive-console-during-debugging-in-phpstorm-9-5-eap/
Upgrade your PhpStorm to the latest version -- which is 2017.1.2 right now.

Using Brackets and MAMP to preview php file

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";
?>

How to identify where the "Error" is located in a script file using Sublime Text 3

I am using ST3 on a PHP script file.
The lower left corner indicates I have "1 error" somewhere in the script.
How can I locate where the error is and what it is?
Note: the "Line 612, Column 13" simply tells me where the cursor is at this moment. It is not where the error is located.
Use SublimeLinter-php, This plugin provides an interface to php -l. It will be used with files that have the “PHP”, “HTML”, or “HTML 5” syntax.
Usage Example
There is also Javascript , JSON and CSS versions
refer to this question to install SL PHP lint plugin, it will tell you where the error is

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