My problem is, that my Eclipse PDT randomly looses PHP content assist. It happened about a dozen times now and I can't figure out, what causes this. It used to happen about once in two weeks. I install a plugin or just close Eclipse and sometimes, when I start it up next time, it looses basic PHP assit, like "in_array()". But all project specific assistance works fine though.
I went through a lot of tips, checking my window > prefs > php content assist, checking if PHP support is added to the project, checking my project's .buildpath, making a clean build, starting Eclipse with -clean option. These things just don't help.
What I used to do (and will do now) is to restore an Eclipse backup, meaning I have to restore my pdt_workspace and my Eclipse install folder both or PHP assist will not work. I've tried restoring parts of these folders or just on of these, but it seems, I have to restore both of them to get content assist back. I went through this a dozen times now, so fortunately I make weekly backups. ;-)
I don't know, what makes these problems happen. Does anyone have some similar problem or any idea about this?
/sorry for bad english/
UPDATE:
I don't know what's going on really, but I got PHP assist working again, two times. First time it started working I've been a lot of install/uninstall and it just came back working. But I've lost it again for no reason. This time, I've uninstalled Yiiclipse and Zen Coding plugin and PHP assist started working. But I reinstalled them and PHP assist is still working! WTF?!
I can't see any logic in this....
I managed to solve my problem. After a lot of testing I ended up removing Zen Coding and Yiiclipse both and doing a clean + build on all projects. This seem to solve my problems and give back PHP code assist.
The downside is, I don't have Yiiclipse and Zen Coding now....
Well, after much grief with this I opened up Eclipse, and right click the project, go to Add PHP support... and voilá. That did the trick.
I experienced this issue due to Upgrade from Helios -> Luna & Content Assist, Key references, variables etc. suddenly stopped working. This was due to incompatible db structure in h2 database from older one.
To resolve this, just remove the data or files from :
<your workspace directory>/.metadata/.plugins/org.eclipse.dltk.core.index.sql.h2
Related
I'm a little lost here and didn't know where else to go so I thought best place to ask would be here... So, I recently upgraded my site's server from shared to VPS after which I attempted to download an Excel report from my DB like I usually would do regularly. However, since the upgrade after I download it, I get an error when opening the documents; it gives me the option to still open it but it is clearly corrupt or something. I have attempted to debug this issue but I am most definitely struggling with this one. I've also made sure I'm using the most recent version of PHPExcel but sadly this didn't resolve it. The error I'm experiencing is as follows:
The file format and extension of "myReportName.xls" does not match.
If anyone can shed a little light on what might be going on here I'd really appreciate it, and thanks in advance!
UPDATE: I don't think this would affect it, but I thought I'd add I also had a bug with my DB after the upgrade where nothing would insert due to fields not having a default value. They worked fine on the shared server but on the VPS I had to edit all my columns to have a default value of null. Also in case someone asks I didn't think it was necessary to post my code as it was working fine before the server upgrade so I thought the bug wasn't there, but if I'm wrong feel free to let me know.
I recently started web development. The course I took was to install WAMP and start developing right away. I used an atom text editor, this -combined with wamp- proved to be a very fast way to write client-side code(HTML, CSS, Javascript).
But when I started to write serverside PHP things got a little messy. I should probably explain my site's structure here.
I keep separate PHP, CSS, javascript files for every page on the client side, for the server side a have 2 different types of PHP files:
Files that only perform a specific operation on the database(For example returning "5 more answers"). These are always called by AJAX requests.
Files that load the page for the first time. These are only used when the user opens the page for the first time, they do necessary database queries and return the page. Later requests always go to the 1st type of PHP files.
Now regarding my problem. I debugged until now by printing variables to the screen with var_dump() or echoing. But this started to become too slow as the data I work with grew. I wonder if there is a way of debugging which will let me but a breakpoint in one of my PHP files. Then, when I open it on the browser, on the localhost I created using WAMP, will let me go through the PHP file step by step.
I have been dealing with this issue for 3 days, I tried to make it work with Eclipse IDE but couldn't find a way. Also, there seems to be no tutorials or Q&A on the internet regarding the issue.
Breakpoint debugging opens a whole new world, and is the natural step after var_dump() debugging. Not only does it speed up development, but it provides much more information about your code, as you can step through each line and see what values have been set at each step, and how they evolve as your program executes its code. This means you can track the entirety of the values at different stages with one run - imagine tracking all variables at each point using var_dump()!
Although choosing an IDE is a personal decision based on personal taste, i strongly recommend you try out PhpStorm. If you can get a student licence go for it.
PhpStorm has extensive documentation & tutorials on all features in the IDE, debugging is no exception:
https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html
https://www.youtube.com/watch?v=GokeXqI93x8
I don't know of a specific solution to your issue. I'm not exactly sure what you're doing but as a quick tip, I find add the following snippet to the top of the file useful as it will highly error more easily rather than browser just say nope.
error_reporting(E_ALL);
ini_set('display_errors', 'On');
Hope this help you a bit.
I tried out what's recommended in comments and answers. I first tried Netbeans. To be fair it disappointed me. Download kept getting stuck at 100%, even for different versions. When I stopped downloading and went ahead to create a php project, there was missing parts I guess. I couldn't even manage to create a php project. But that might just be me not being able to do it.
Then I followed #leuquim's answer and #Alex Howansky's comment and downloaded PHPStorm. And I got it to work in no more than 20 minutes. I downloaded it with a student's licence. For people who want to use PHPStorm with WAMP here's a Youtube tutorial:
https://www.youtube.com/watch?v=CxX4vnZFbZU
One thing to note in the video is that, maker of the video chooses PHP Web Application in the Run Configurations. That has been changed to PHP Web Page.
I would love to switch from Sublime to VSCode completely. While developing Go is a great experience, PHP is not much fun with some libraries.
At work, we use the OXID e-Commerce solution for many projects. The biggets has more than 150MB in PHP code.
The two big PHP extensions (the ones by Felix Becker and Hvy Industries) both fail to work properly with OXID. I tried to let both index for a whole weekend, but I get no results except 100% CPU load. I think I know why, I can try to elaborate if someone is interested.
All I really miss/need is a simple "Go to definition". In Sublime, I have this simple "right click -> go to definition" which lists all func/method definitions with this name. It's not perfect, but better than nothing. Is there something similar to this for VSCode? Or anybody who had more luck with OXID projects and VSCode?
I really liked flexibility of emacs but it is really annoying to make it work. I want to use it for web development html, css, javascript, php. I first tried emacs-starter-kit . It didn't included nXhtml. Also C-g key binding does not work (they call it starter kit but basic key command does not work). I think it is mapped for git control. That's a frustration for a beginner. Then I replaced emacs-starter-kit with nXhtml. At least C-g is working. But code completion sucks, M-tab does not work. I tried code completion from nXhtml menu with no success. Also NXhtml mode did'nt colorized my file if css is mixed with html. Isn't it recommended for mixed html, css,php files. So why it doesnt work?. Why Emacs folks do not aware of convention over configuration? Dam! ship it something works! Please help me before I am getting crazy. I use Ubuntu 10.04 and emacs-snaphot-gtk 23.1.50-1. Please guide me step by step with your working dotfile url. Even I accept I am a dummy, it is really annoying and frustrating to use emacs.
Have a look here if you haven't already. You are running Emacs under X. In that case, you should try if Esc-Tab works for code completion. M-Tab might be lost to the X for switching between processes.
Programs like Emacs and Vim demand that you invest time and effort before they start paying off. They pay off really good in terms if not getting in the way of real work. I suggest you to find time to get acquainted with such programs before venting out.
Has anyone got these to work together seemlessly? I have tried, had some success using the plugin at http://phing.info/trac/wiki/Users/Documentation/CruiseControl, but have failed to:
Get the metrics graphs working (nothing appears)
Enable the "PMD" - project mess detection - reports
Are there any other ant-specific commands that must (can) be run in addition to my phing build script?
Also, the front page of the reports section dumps a heap of log information, and I'm trying to get rid of that too.
Cheers for any help ... we are running phing 2.3.0 and phpUnderControl 0.4.7.
Paul
Our application framework makes heavy use of Phing, and we've got that integrated under CI with phpUnderControl. We do have the metrics and PMD working now, and honestly, it was a little bit of an accident that it started working. But we're still missing the code coverage (working on it) and the phpDoc output (working on that too). I'll try to remember to come back and update this when we're done.
I have found that the main reason for the metrics not showing up is an incompatibility with the ez library that phpuc uses for the rendering. You'll get this NullPointerException on the page, right? Then when you try to run a build manually, you'll get this obscure error about index and divide by 0? What's happening is the ez graphics library that ships with phpuc is old, and you have to upgrade it. I hope that's a clue for you. We didn't have trouble with PMD stuff, so I don't know why that wouldn't work for you. If you want to update your question with more specifics, maybe I can elaborate on what's worked for us?
To answer my question, in the end I figured it was easier to just use an ant build script to make everything work.
I think phing is good when starting out, and has an excellent dbdeploy feature (which I use in phpUC), but for getting the metrics and the PHPMD integrated you are better off using ant - the XML is not hard.
Cheers