I'm recently getting back into programming after taking a break for quite some time. I'm currently trying to rebuild my CakePhp 2.X apps for CakePhp 4.X. I'm developing in a local environment using Bitnami WAMP stack.
The issue is that development is very slow because changes do not seem to be taking effect immediately. I have tried disabling all caching by using
Cache::disable();
I've tried placing this line in various places
config/boostrap.php
config/app.php
config/app_local.php
src/application.php
How this is impacting me: I'll make an update, for instance, to a model table file or controller file. I'll go refresh my site to preview the change and either there is no update or there might be an error. To fix the error, I try to undo the changes I made. I go back to my browser and hard refresh the page. I continue to see the same error for 10+ minutes. This often leads me to wanting to undo previous steps but I know that those previous steps didn't cause the issue and it was only the most recent change that caused it. It's making it difficult to keep track of what changes are causing issues and what solutions are working. Even something as simple as updating my navigation element (templates/elements/nav.php) to add a new link does not show on the page when I refresh. I've also tried clearing my browser cache (I use Chrome).
Did you try to clear all keys? You can do it with:
// Will clear all keys.
Cache::clear();
Cache::disable() should work also.
You can also delete the contents of /tmp/cache/ if the caching is set on File.
Maybe the problem is Bitnami WAMP itself. Try to disable the server cache:
https://docs.bitnami.com/installer/infrastructure/wamp/administration/disable-cache/
If you are developing on top of an AMP Stack or customizing any
Bitnami Stack, your files (like JavaScript files) may be cached by the
server and even you modify them your changes will not appear to be
applied.
In order to disable the cache in the server and let the files be
served each time, disable PageSpeed for Apache and OPCache for PHP,
enabled by default
-i updated my WordPress today morning to 3.8.1 version , after the update of my WordPress i unable to update any of them and unable to view them in visual field and text field when i press edit my post.
Does the same thing happen if you try using a different browser that you do not normally use? For example, if you use Chrome, try and see if it works in Firefox.
If one browser works but the other does not, then you are experiencing a fairly common caching issue, where your browser is caching javascript files from the old version instead of retrieving the newly updated files.
This happens especially if you have certain types of "speed optimization" plugins or similar code running on the site, because these often create settings to have longer cache intervals for common static files such as images and css and javascript files, to make browsers not have to retrieve as much data. WordPress uses cache-busting version numbers to try to reduce this problem, but these methods are not always effective.
The only solution is to clear the browser cache, but a surprising number of people have difficulties doing that. Browsers are persistent buggers. I recommend clearing the cache, restarting the browser completely (note that some browsers, like Chrome, remain running in the background.. you have to actually kill them manually from the taskbar or similar), and then clearing the cache again after restarting it. Even then, it may take a few attempts.
Alternatively, you may have not have gotten a complete upgrade and some of the files may not be installed. There is a "Reinstall" button on the Upgrade screen that will do a complete file installation over your existing installation. This will not erase any data, it simply gets the core files from WordPress.org and reinstalls them in-place. You can try this to see if it helps. As always, before performing anything like this, make sure you have an up-to-date backup of the site.
I am very very new at PHP programming.
I am making up some code to test my learning but I just discovered a very annoying problem.
I have no idea about the cause, so following I'll describe my situation and I'll leave to you the "honor" to find the problem :)
I use dreamweaver to write my PHP code.
Once I made all the changes, I save the file and refresh the browser page to see the result.
Well, here is the problem. For like 30seconds nothing changes, after this time delay the page actually refreshes. There seems to be a delay between when I save the modified file in dreamweaver and when the browser (Chrome in my case) sees the new file.
I tried different browsers and I also verified that the file is physically changed...I have no clue.
It has nothing to do with Dreamweaver.
You have to disable OPCache
Some software such as MAMP turns on OPCache by default in the php configuration file (php.ini), you can disable it this way
opcache.revalidate_freq=0
Developing with Netbeans 6.9.1
Using Firefox/Safari
Using MAMP Server
When developing a PHP application through Netbeans I find that most of my changes will show up in the browser when I Test Run my code. Little things such as links I do or css changes are lost or are not carried over in the browser test even though I can refer back to the line of code and note that what has been displayed is not my code. I am using Firebug so I can definitely know that links or styles are not being carried over into the test run.
How do I fix the problem to make sure I can accurately test my developments?
As mentioned by Thilo, this sounds like a browser caching issue.
I use a Firefox plugin called Web Devoloper, this has an option to simply disable/enable your browsers cache in a drop down menu. It also has many other features that you would find useful too.
Often, when I am developing in PHP, I want to see minor changes instantaneously. This requires me to either FTP to a web server and then refresh, or use a localhost server, both of which(as I understand) are essentially the same thing.
What I would like to know is, is there an IDE or other way to parse PHP output in a dynamic fashion? I guess what I am thinking of is the WYSIWYG pane in some editors able to display code real-time.
I understand the client-server paradigm, but would rather not have to upload the same file 40 times when making changes/error handling/etc.
You can always just save your files inside your localhost folder. Tools like xampp make running a php server effortless. Open the file in a browser, and whenever you make changes they will instantly be visible without having to copy the files around.
I've heard that ActiveState's Komodo is IDE for php behaving more-less the way you described (at least it has dynamic syntax check, so it has to parse the script locally).
Try Komodo Website.
You should setup your IDE to edit the ftp files in place. I use Edit Plus although I am sure others will do the same thing. In this mode, you open the files in the ftp directory browser (identical to the local one) and when you save, it is automatically uploaded to the server. You can also set it up to save the file locally in a backup folder since it sounds like you aren't using source control. You then set it up so when you CTRL+B, the remote file will open a browser inside the editor (Look under project settings for the root paths).
And yes, while the localhost webserver can be similar, there will be some incompatibilities you will have to overcome, especially if you are running windows and your host is a unix variant. For example: money_format() for one doesn't exist on windows, but is very usefull under linux. Also the configurations will be different even if the OS's are the same.
Good Luck!
This probably doesn't come up very often because it's so easy to install a local web server. What is your OS?
Also if your remote web server is accessible by SSH you could learn a screen oriented text-editor (such as the VI editor) and edit the source files on the server.
I feel the same way, but get around it easily by using an editor/IDE with FTP support. Configure your account, and then edit files locally, but the editor/IDE pushes them to the server when you save them. Notepad++ and PSPad both do this on Windows, and I use Gedit (default Gnome text editor) when on Fedora. A Google search for "FTP text editor" or "FTP IDE" might serve you well.
You could use the PHP command line, but that displays its output in plain text. You could take that output, save it as an HTML file, and display it with a browser, but I'd think that's more work than just setting up a local web server.
Aptana's PHP plugin has a built-in PHP server, so that's probably close enough to what you want, although I've never used it so I can't directly say anything about it.
I may be mistaken, but it seems like you want to see changes without having to restore/maximize browser and clicking 'refresh'. So in other words, you want to see results without the inconvenience of having to maximize browser, clicking refresh, the minimizing it to get back to the editor.
As far as i know, there is no IDE that will show PHP code dynamically in real time.
What you may want to do is, if you can, bind it so when you save a document, it automatically loads up a browser and refreshes the page for you.
Any IDE should notify you of syntax errors (normally with the wavy red underline), which will cut down on a lot of FTP-ing just to find you missed a semicolon.
Even though you say you don't want to use localhost, I would suggest using something like WampServer. The best thing about the latest version is you can install different PHP, MySQL and Apache "modules" and switch between them to mimic any server configuration. For example, "Apache 1.3, PHP 4.2" or "Apache 2, PHP 5.3" etc.