Category Archives: aptana3

How to configure Aptana 3 with apache 2.4 as localhost

I have apache 2.4 located in:

c:\apache24\htdocs

and my project is located in:

c:\apache24\htdocs\swb

within the swb folder i have a public folder and in the public folder I have demo.php which contains:

 <?php echo "hello world"; ?>

the apache24 server is running on port 80.

could someone explain how to configure this server in aptana 3 so when I use chrome, firefox or edge from within aptana I can display the page in the browser?

If I go directly to http://localhost/swb/public/demo.php within a browser it works but I'm unable to get aptana 3 to go there

UPDATE: Selecting "Use base URL: http//localhost/ and checking the box append project name achieves the desired results.

2 issues: (1) When I try to use "Use built in web server" it goes to:

http://127.0.0.1:8020/swb/public/demo.php

and then displays a blank page. However if I create a proper html page the internal web browser works fine.

(2) How and when would I use "Use the selected server" - and how would that be configured?

Disable syntax errors for PHP code inside JavaScript file in Aptana Studio 3

I am having PHP code inside my JavaScript file, which is processed by the server by setting the handler for the .js file extension to php5-script using a .htaccess. In Aptana Studio, I couldn't find an option in the settings where I can set the file type to a mix of PHP and JavaScript, or disable errors, or anything else.

I have found a similar question but this is just related to the PHPStorm IDE which I do not want to use.

The content of my .js file currently looks like this:

<?php
header('Content-type: application/javascript');

$app_base_path = $_GET['_app-base-path'];
$app_route = $_GET['_app-route'];
?>

$(function() {

    var APP = {

        // syntax errors are thrown here
        // the single quotes could be escaped to reduce syntax errors
        // looking for a way to make a code like this possible without any syntax errors
        base_path: '<?= $_GET['_app-base-path'] ?>',
        route: '<?= $_GET['_app-route'] ?>'

    };

    $('body').append('APP.base_path: ' + APP.base_path + ' --- APP.route: ' + APP.route);

});

Disable syntax errors for PHP code inside JavaScript file in Aptana Studio 3

I am having PHP code inside my JavaScript file, which is processed by the server by setting the handler for the .js file extension to php5-script using a .htaccess. I tried opening the .js file in Aptana Studio using PHP Source Editor and JavaScript Source Editor, however, both editors highlight the php code as syntax error. I couldn't find an option in the settings where I can set the file type to a mix of PHP and JavaScript, or disable syntax error highlighting for PHP code in JavaScript, or anything else.

I have found a similar question but this is just related to the PHPStorm IDE which I do not want to use.

The content of my .js file currently looks like this:

<?php
header('Content-type: application/javascript');

$app_base_path = $_GET['_app-base-path'];
$app_route = $_GET['_app-route'];
?>

$(function() {

    var APP = {

        // syntax errors are thrown here
        // the single quotes could be escaped to reduce syntax errors
        // looking for a way to make a code like this possible without any syntax errors
        base_path: '<?= $_GET['_app-base-path'] ?>',
        route: '<?= $_GET['_app-route'] ?>'

    };

    $('body').append('APP.base_path: ' + APP.base_path + ' --- APP.route: ' + APP.route);

});

How to enabling syntax hightlight for .htaccess in Aptana Studio 3

I am using Aptana Studio 3.6.1 ("Kepler" Eclipse Core) for PHP development and I want to enable a syntax highlighting for editing .htaccess files.

I tried this solution but my Aptana instalation don't have the "Properties File Editor" or "Java Editor".

I also tried to install it, at "Help" > "Install New Software", but the Kepler release site (http://download.eclipse.org/releases/kepler) don't show the "Java Development Toolkit" under "Programming Languages".

Note: I really, REALLY prefer to use "native" Eclipse for PHP, but the company that I'm working forced me to use Aptana for "policy reasons".

If someone has any other suggestions I'll be grateful.