Aptana "PHP Version" doesn't stick in project properties - aptana

I have a project that explicitly needs PHP 5.4.x compatibility, so I right click on my project and go to Properties. Then I click the "PHP Development" menu on the left, and select "PHP 5.4.x" from the dropdown. It works fine until I restart Aptana--then it goes back to "PHP 5.3.x" which I guess is the default. Is this a bug in Aptana? How do I get the version to stick even when I restart?

The only temporary solution I found (in Aptana build 3.6.0.201407100658) is setting the PHP 5.4.x version from Project->Properties from the opened file. You just can't close Aptana or the file but can come handy when working on few important files.
update: You can add project_path/.settings/com.aptana.editor.php.prefs file that reads:
eclipse.preferences.version=1
phpVersion=php5.4
In my case, this helped.

It seems this is a serious bug in Aptana. Just like our friend Viktor Sulak said: edit the file .settings/com.aptana.editor.php.prefs,
But, if your workpsace does not have this file "com.aptana.editor.php.prefs", simply create it with the content:
eclipse.preferences.version = 1
phpversion = php5.4
and everything gonna be all right!

Related

Working directory error

I am working with PyCharm 4.04. Since I installed it, every time I open it, as default directory I get this:
C:\Users\Laura\AppData\Local\Temp\main.py1.tmp>cd
Which gives me an error when trying to use the console:
Error:Cannot start process, the path specified for working directory
is not a directory
But even if I change the directory, the message does not disappear.
The terminal, though, it does work and I can run projects, but I would like to use the console.
Another solution is to close the project, run rm -rf .idea and re-open it. Apparently Pycharm gets confused by some direct folder manipulation and doesn't reflect it properly in his .idea/*.xml files
I also got this error, and it got resolved by setting the default working directory. Follow the below path, and set the Working Directory to the folder where your code resides.
File > Settings > Build, Execution, Deployment > Console > Python Console > Working Directory ...
I finally solved the problem.
I think it all started because the first project that I opened with pycharm was in my "download" folder, so the working directory was automatically set to a temporal folder by default and allthough I moved the project to another folder and I manually changed the working directory from the terminal, it was not working.
The solution was creating a new project and giving a correct path to the new project. It seems very easy but it was not that obvious.
In the upper right corner click on small ▼ next to your main to run (look to the left from green right-pointing triangle)
Select Edit configurations.
In ▼ Python select the proper configuration name.
Look at the Configuration panel.
Fix items Script and Working directory.
pycharm
I had this same problem and just had to reinstall pycharm. It's a quickfix and I can't ensure it won't happen again.
I solved this by replacing all instances of the old filename and old directory with the new one in .idea/workspace.xml
It can be done with PyCharm running.
#user1068430 has the answer in the comments to the question:
When you open a project open the directory not a specific python file.
Instead of ~/Documents/myProject/main.py open ~/Documents/myProject
If you "open" the .py file then you'll have to set the working directory (File > Settings > Build, Execution, Deployment > Console > Python Console > Working Directory) every time. If you "open" the directory containing the .py file, then PyCharm will open and all of your .py files will be available in the left window. Select one of them and you're good to go.
i had the same issue, the error comes up when i want to upgrade my packages and when i run my project "this FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\youruser\AppData\Local\Temp\gen_py\3.7\__init__.py'" i found that the Temp file in C:\Users\youruser\AppData\Local was corrupt and it was fixed by deleting the "Temp" file, once deleted it will automatically create a new one with "gen_py" in it
To anyone with similar issues: Python interpreter virtual environment is where your python.exe sits. The working directory is where your script sits. To make everything easier, open a new project, scroll to location where you script is stored, and select. Click the interpreter option, click existing (if old one worked) or choose the python.exe. When asked, open the project in a new window, close old one to avoid confusion.
source = banging my head against the console for past few hours.
if the above mentioned solutions are not working, you can restart a new project.
file > New project...
then,
create a new project.

(when adding jar) - Module "android" must not contain source root

I'm trying to add gdx-tools.jar to a libGDX project in IntelliJ. The result:
Module "android" must not contain source root ".../android/src". The
root already belongs to module "android".
This is what I've tried:
project structure > libraries > new project library > java > select "gdx-tools.jar" >select module "desktop"
project structure > modules > select "desktop" > new > jars or directories > select "gdx-tools.jar" >
Ideas?
Just by going to the Artifacts Settings, Modules, Sources tab, and you will see 2 folders called "gen" and "gen[generated]", delete "gen" by clicking on the X icon to the right of it.
look:
I had run into a similar issue as well:
Module "(my_project)" must not contain source root "(my project)/src".
The root already belongs to module "(my_project)".
As I couldn't do anything on IDEA's configuration UI, I opened up the IDEA project file (my_project.iml) in vi, hoping to find out what's wrong:
<sourceFolder url="file://$MODULE_DIR$/my_project/src" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/my_project/src" isTestSource="false" />
<!-- Duplicate entry found in project file -->
So eventually I solved my case by removing the duplicate entry manually.
As the IDEA project files were generated automatically from Gradle files, I have no idea what caused the duplicate entries to be created, but for those facing similar issues, a quick glance at the .iml file may help.
simple, just 'delete my_project.iml file and import project once again using File->New->Project From Existing Sources'
I had same problem. Solved it by completely deleting project, then clone it back from GIT.
I solve in with
Deletion both gen and gen [generated] from Source Folder.
I fixed the issue by deleting .iml files of modules causing the issue.
By deleting it in the module, and then importing it again. solve the problem.
I think it's a bug of IDEA.Eclipse is fine.
Hopefully idea developers will see that
I solved the problem by simply renaming the project. Right click on the project, then click refactor.
IN Intellij IDEA when you tap on parent module, in left pannel, make sure in right one, inside structures of child modules, folders are NOT marked as "Sources" and it will be fine.
open:
file > project structure > modules
you will see 2 models
"project name"
"project name"_android
just delete "project name"_android in the module, that solved the problem for me.

File association is variable on a file basis

I have a problem with Aptana file/editor associations. I have installed PDT into Aptana. In a directory I have three (and more) PHP files. When I open the first Aptana opens the "PHP Editor", when I open the second I get an Error ("Unsupported content type editor") and with the third Aptana opens the "PHP Source Editor". All have the same extension (.php). I want Aptana to open all PHP files with "PHP Editor". When I explicitly open the files that throw the error with "PHP Editor" I get the same error.
I have activated the PHP perspecive. Content Types > Text > PHP Content Type has *.php (locked), Content Types > Text > PHP Source has *.php (locked), too. In the file associations I have both editors (and two text editors) listed for *.php and "PHP Editor" is the default editor.
The project is a (local) GIT repository. In another project (also a GIT repository) it seams to work (all *.php files are opened in the "PHP Editor").
Can somebody explain me that "magic" and give me a tip how to solve my problem. I don't want to switch to another IDE or something like that…
EDIT
Here is how the different files behave:
Open With… Open With… Open With…
file double click PHP Editor PHP Source Editor Default Editor
-------- -------------------- ------------- -------------------- --------------
a.php Error Error PHP Source Editor Error
b.php PHP Editor PHP Editor PHP Source Editor PHP Editor
c.php PHP Source Editor PHP Editor PHP Source Editor PHP Editor
Like described by Sarah Kemp in her answer the different behavior of b.php and c.php is correct. But why can I not open file a.php with the PHP Editor?
EDIT 2
When I look at the file properties, b.php and c.php have the type "File (PHP Content Type)" and a.php has "File (PHP Source)".
You can set file associations on a per file basis too, it looks like maybe that is your problem since your other repo is working correctly?
Right click on your file in the Project Explorer (this is where I tested) and choose 'Open With...' and select the editor you prefer from the sub menu. Once you have selected an editor in this list, Aptana will remember your preference for that file and use it when you double click in future - even if all other file of that type open with something else.
Hope this works for you.

Symfony Warning : rename (../app/cache/dev , ../app/cache/dev_old ) : Access Denied . (Code : 5)

I am working on Symfony project.
When i try to do :
php app/console cache:clear
i get the following ErrorException:
Warning : rename (../app/cache/dev , ../app/cache/dev_old ) : Access Denied . (Code : 5) in ../vendors/Symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php on line 76
What is the problem here? I have given all permissions to the user on my machine (Windows 7 OS). Any ideas why it is happening?
Thank You.
Be sure that the files are not in use (as meze pointed out). If you're using something like TortoiseGit or Netbeans, etc - be sure to mark the cache folder as ignored so that they are not accessed.
If all else fails, download a free program like Unlocker that will allow you to quickly and easily detach running processes from the files/folders you are trying to modify.
To expand on leek's post, Symfony 2 cache-clearing operations shuffle the cached items across different folders during the cleanup. Part of this process includes creating cache/dev-new/ and cache/dev-old/ folders.
If you are using Eclipse or another IDE that dynamically monitors subfolders within your project, the IDE will nearly instantly spot the new folder creation and look in those folders for new files (in Eclipse, I noticed the DLTK module constantly doing this in the Progress View). This may unfortunately get in the way of Symfony, which wants to rename and/or delete these folders.
Specifically with Eclipse Indigo on Windows 7 64-bit, you can remove the cache/, cache/dev/, cache/dev_old/ and cache/dev_new/ folders from the build path by right-clicking your project and selecting "Build Path > Configure Build Path...". This originally had no effect for me; I kept seeing the DLTK module trying to index the cache folders. I ended up uninstalling the Aptana Studio plug-in, closing all Editor documents, shutting down Eclipse, manually deleting the sub-folders in the cache/ folder, running Symfony cache:clear, then starting up Eclipse and reinstalling Aptana. Seems to have worked thus far.
It's an issue with Symfony 2.0.x and Symfony 2.1.x. These a workaround for this:
Open the file: src\Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand.php
and add the statement sleep(1); where the directory creation is failing, in the execute() function:
//...
rename($realCacheDir, $oldCacheDir);
sleep(1);
rename($warmupDir, $realCacheDir);
//...
You might have to re-open the CLI twice and run cache:clear, but it will fix the problem after that
If you're using text editors as Sublime Text try to ignore path of cached files
Go to Preferences/Setting
edit config file
{
...
"folder_exclude_patterns": ["var","node_modules", ".git"],
...
}
in my case
Cache folders containers.
Symfony 4
/var
Symfony 2
/app/cache
Nice coding!
I had the same issue with Symfony 4.1.13 and the root cause was that the VS Code was using the file "var/cache/dev/srcDevDebugProjectContainer.xml4QSKuA".
The issue was Cannot rename "var/cache/dev/srcDevDebugProjectContainer.xml4QSKuA".
I fix it adding **/var on the fields "Files to Exclude"
See the following steps:
1º Step:
2º Step search for "exclude" word, then add **/var/cache as the following image:
It's worked for me.
To have tranquility once and for all I create clear.bat file in MyProject folder under Windows 7 .
rmdir d:\symfony\framework-standard-edition\app\cache\ /S /Q
I guarantee 100% effectiveness for cleaning cache. Some minor problems can occurred after first time refresh website: Symfony must recreate some folders they need.
SYMFONY AND ANTIVIRUS
Multiple symfony calling in local windows machine get cross with some Antivirus software such as NOD in my case. Exclude symfony cache folder from real time protection

Qmake does not support build directories below the source directory

I have created an application that compiles and runs like a charm on OS-X. I would now like to start getting it to work on Windows. To start, I copied the project to a windows machine and just tried to compile, but got this error:
:: warning: Qmake does not support build directories below the source directory.
Any ideas?
Set the shadow build directory to some folder on the same level of your project directory:
folder/
project/
project-shadow-build-release/
project-shadow-build-debug/
You can do this in the "Projects" view, via the toolbar on the left. To me, this warning was just an annoyance, a project never failed to build because of it.
Don't copy your project.pro.user file when you are copying a project from one machine to another, or from one directory to another. When you open the project, Qt Creator will offer to create a new build directory in the proper place.
Andref gave the correct answer to resolve this warning, but you may want to understand why this requirement exists.
In fact, the build directory must be at the same folder level as the project (i.e. it can't be above or below). The reason why is that the linker is called from the build directory. Hence, any relative paths to library files will be different than what you entered in your project file.
It kinda sucks. I like to put all intermediate files in their own folder. But you simply can't with qmake.
.pro.user are generated files by Qt Creator. They are unrelated to qmake and should not be touched (and not put into a VCS for that matter)
Just remove the files with the pro.user extension , worked for me
I also got this, trying to compile a project created on linux.
Another way to solve it is to change the paths in the .pro.user file (in the directory of your project)
Right Click on a project: Set As Active Project
Click on the Projects button (The one with the spanner image)
Edit build configuration : Debug / Profile / Release / and change the default directories, OR just uncheck the Shadow build check box.
The Build directory path should now change to black, from red

Resources