Eclipse Symfony 2 environments not found - php

I am experiencing a problem: Eclipse doesn't detect the environments of my Symfony 2 project.
This means I can't configure the "Launch Configuration". I have no idea why... I use the Plugin from here: http://symfony.dubture.com/
This is how it looks on my PC (empty dropdown menu for the environments): http://abload.de/image.php?img=eclipsesymfony2env0lu66.png
This is how it should look like: http://symfony.dubture.com/images/screenshots/configuration_tab.png
In the folder app/config, there are a config.yml and config_dev.yml, config_prod.yml and config_test.yml among some other files.
Versions:
Symfony 2.7
Eclipse 4.4.2 (PHP Plugin and the Symfony 2 plugin are up to date)
PHP 5.6 VC11 x86 Thread Safe
Apache 2.4.10 VC11 x86
Win 7 SP 1 x64 (admin account)
Greetings

Make sure that routing code assist works (for ex. source -> insert symfony route). If not, make sure "Dumped container" path is set correctly (project properties -> symfony)
Create launch profile and select web/app(_dev)?.php file
Go to symfony tab ;)

In order to find environments, plugin Symfony Dubture needs web folder added to Include Path (Project Properties -> PHP -> Include Path -> Source tab -> Add Folder button -> web folder should be checked).
Current version of the Symfony Feature (1.1.1) has all controls disabled in Symfony tab in launch configuration dialog. Code which obtained environments and routes stopped working correctly and hence this tab is now turned off and should not be used.
In order to run/debug Symfony app, launch configuration should be configured manually. It can be done in the following steps:
In Debug/Run Configuration dialog, create new PHP Web Application configuration.
In File field enter text in the format: \<projectName>\web\app_dev.php.
In the Server box, select Configure button to open Edit Server dialog.
In the Server tab, Document Root field should point to the project parent folder.
Prior to use of the created launch configuration, start the php built-in web server using the command: php -S localhost -t path/to/project/parent/folder

Related

Create form file in PhpStorm using Symfony plugin

I'm currently working on a tutorial for PhpStorm with Symfony... but I'm stuck :/
https://knpuniversity.com/screencast/phpstorm/forms#play
I cant create a form file with the Symfony plugin (like at the very beginning of the tutorial link), when I press Cmd + N on the appbundle and the click on form (with the Symfony logo...) nothing happens - PhpStorm doesn't respond and create a new file...
Can anyone help me with that please?
I reinstalled the plugin already and rebooted and so on...
You have to set your project as symfony project first:
file > settings > langages & framework > Symfony and then enable it
I am assuming that you are editing files locally and then uploading them to a webserver - rather than editing the webroot directly. If the latter then my suggestion is unlikely to help.
I was able to fix it by;
Closing the project in Symfony.
Creating a new project from my existing remote files, in a new local repository
Downloading the files from my development server to my local repository (my dev server is actually a VM hosted on my development machine, but I don't think that is important).
Allowing phpstorm to do its normal startup stuff recognising namespaces
Enabling the symfony plugin in File/Settings/Languages & Frameworks/Symfony
I did not need to restart phpstorm although the plugin says you need to to enable plugin for the project
This fixed the problem for me, and also fixed a certain amount of Symfony specific 'autocomplete' which wasn't working for me either.

Xampp and symfony on windows7

I'm quite new with symfony and i'm trying to develop a base web application.
I install and configured symfony on my pc (windows 7 64bit) following the documentation and all works fine.
I run the server with command line (php bin/console server:run) and test the application in browser successfully.
Then iwould like to move the symfony folder under my local Xampp (xampp\htdocs\symfony\myproject) installation that i use for php development since now.
My problem is that when i run localhost\symfony\myproject\web the symfony welcome page is shown but if i modify the index.html.twig template no change are displayed.
Some routing problem? vhosts config?
try with
localhost\symfony\myproject\web\app_dev.php
since localhost\symfony\myproject\web is the prod url and has some cache, which may "hide" your modification

Netbean autocomplete doesn't work in some folder

I have a Yii 1.x project, and i use Netbeans 8.0.2. In this website there is an admin folder in web folder. This is one netbeans project but 2 yii project with one framework (one for users, one for admins). When i am in the web folder the auto complete works, however it doesn't work in web/admin folder.
I tried everything:
-Delete cache manually - C:\Users\username\AppData\Local\NetBeans\Cache\8.0.2
-Reinstall Netbeans
-Delete the project without source code, after create a new project.
-Code completion on. (tools->option->editor->codecompletion)
-Updates
Here is my "about":
Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Updates: NetBeans IDE is updated to version NetBeans 8.0.2 Patch 2
Java: 1.8.0_11; Java HotSpot(TM) 64-Bit Server VM 25.11-b03
Runtime: Java(TM) SE Runtime Environment 1.8.0_11-b12
System: Windows 7 version 6.1 running on amd64; Cp1250; hu_HU (nb)
User directory: C:\Users\Siki\AppData\Roaming\NetBeans\8.0.2
Cache directory: C:\Users\Siki\AppData\Local\NetBeans\Cache\8.0.2
So can i enable auto complete?
Since you are using Yii 1.x, there is a certified NetBeans plugin for Yii 1.x in its plugin repository. This plugin will provide options like
Creating new Yii project from netbeans. No need to use Terminals
Code completion.
Go to a Class file by clicking on accessible snippets.
Plug this in you NetBeans to get above benefits as well as to overcome auto code complication problem, which you mentioned in your post.
Plugin page # http://plugins.netbeans.org/plugin/47246/php-yii-framework-netbeans-phpcc
In project properties > Include path, add the folder where are the yii framework base files
Right click over the project in tab projects, then select properties
Image project properties
This enables code completion.

Intellij Project Structure: Configure PHP SDK

starting with Intellij 13.1 which was released today, it is possible to configure additional SDKs in the Project Structure dialoge. While the old 13.0 version only contained the following three items when clicking on the new button:
JDK
IntelliJ Platform Plugin SDK
Mobile SDK
The new 13.1 update has added several more options as can be seen on the screenshot:
When I click on PHP Interpreter then a directory chooser opens and ask me for the "Select Home Directory for PHP Interpreter". Which folder is the correct one under Ubuntu?
I have tried /usr/bin and I get a message that says: Probably SDK installed in '/usr/bin' is corrupt, and when I choose another directory then the message says: The selected directory is not a valid home for PHP Interpretor.
However, when I go to Settings->PHP I have already correcly configured PHP 5.4 and when I open the details by clicking on '...' then I see the following:
Has anyone tried this? Am I doing something wrong, or is this a bug in IntelliJ maybe?
Open a new local shell/terminal window and type which php
this will tell you where the php binary is installed
in some ubuntu releases the repo's install php as php5, if that is the case you might need an ln -s to php
Although in my PhpStorm (PS-138.2071) it looks like this :
This is done on settings level. Don't do it in project sdk level. Got to settings, look for php. Choose PHP language level and intellij will scan and get the interpreter for you

Zf.php is not a valid action error on a shared hosting

I have a question concerning Zend Tool. I am trying to install Zend Framework on a shared hosting (bluehost if that matters). I have unpacked the latest Zend Framework into my public_html folder and added the path of the framework's library to php.ini include_path.
When I try to run zf.sh with any arguments (for example, zf show version) I get an error:
Action 'path_to_zf/bin/zf.php' is not a valid action.
What could be the source of the problem? Thanks.
To run a Zend Framework website on a production server, you should use a development computer to create the website and then upload the website code to the production server using a deployment strategy such as capistrano, a phing script, rsync or even plain old FTP.
On your local development computer, you use zf.sh (or zf.bat on Windows) as per the instructions in the Quick Start. Once you are happy that it works locally, upload to your shared hosting.
To get a PHP environment on your local computer, consider installed WAMP or Zend Server CE.
I just went through this (with BlueHost) myself.
You mentioned that you added the proper path to the include_path in public_html/php.ini. There are a few other things to check.
First: By default, BlueHost servers are configured to use a different php.ini file (located in /etc/) unless there is another php.ini file in the folder that you are running your script from. You can check by running <? php_info(); ?> and looking for the value for Loaded Configuration File.
In order to get every script in every folder to use the php.ini located in public_html/:
From cPanel, under Software/Services click the PHP Info link
Select PHP x.x (Single php.ini) for the same version as is already
selected (to ensure compatibility).
Second: You'll want to make sure you've added an alias to your .bashrc file (see here)
At this point if your problem isn't solved, you'll want to consider a different method of checking whether or not Zend Framework will be available to your .php files:
Save Zend's Installation Checker file and upload it to the root path of your server. Then view it in your browser. It will tell you if you have installed zend framework correctly.
All tests pass for me, so I don't care that I still get the same error as you when testing through ssh via # zf show version.
More on installing Zend: https://developers.google.com/gdata/articles/php_client_lib#php-path-installation
More on BlueHost php config: https://my.bluehost.com/cgi/help/551

Categories