Bitnami Wampstack: PHP caching requires server restart - php

I setup a WAMP stack for the first time using Bitnami. Got working pretty quickly with vhost and everything, running a couple WordPress websites for local development. The problem is, nearly everytime I save a change to a PHP file the changes don't appear when I refresh the browser unless I restart the Apache server.
I've searched around for a couple days now for a solution but nothing seems to work, considering going back to XAMPP for local development. I tried to disable opcache in the php.ini as someone suggested but that didn't work.
Any ideas what it could be?

In httpd.conf comment out:
# Include conf/pagespeed.conf
# Include conf/pagespeed_libraries.conf
In php.ini set:
opcache.enable=0
opcache.enable_cli=0
Source

Related

Need help in configuring WAMP (phpMyAdmin)

So I have been looking on the net for hours now and I can't solve my problem.
I have wamp installed (WampServer Version 3.1.7 64bit).
I want to open phpMyAdmin through wamp. (I have the phpMyAdmin5.0.2 installed and phpMyAdmin.conf is configured).
I have several php versions installed.(this was done through the process of trying to fix the solution alone).
When I try to open phpMyAdmin I get this error message: [1]: https://i.stack.imgur.com/ZEMaX.png .
I have tried configuring php.ini file (by de-commenting mysqli) it didn't change a thing.
Here's my php.ini file joined in the google drive link: https://drive.google.com/file/d/1fQuVoh5vhRX-MHhYL3zMQ4xNkstO-4Ch/view?usp=sharing .
I have configured extension_dir tp the php/ext folder.
I have similary configured my windows path to the php/ext.
Nothing I try works. Any help is welcome.
Thank you.
Since you're using WAMP, which should include all the pieces you need already working, but also have several PHP versions installed, it sounds like you're installing more than you need which is causing conflicts.
Assume you have no data in your database or web pages that you need to preserve, I suggest removing everything; get rid of WAMP and any extra Apache, PHP, or MySQL/MariaDB installations you have. Clean up (delete or move out of the way) any leftover configuration files, then reinstall WAMP. If you have trouble after installing only WAMP and no other PHP installation, then report back here details of the error. WAMP should come to you working and all ready to go, so if there is a problem, it will be helpful to start from a known base installation without extra configuration files or executable that will cause conflicts.
I'll also point out that the very top of the file you posted states that it's used only for the PHP Command Line Interface, so this is not the configuration file used by anything running through your webserver (like phpMyAdmin or your site). It's a little confusing that there are really two PHP instances (one for the command line and one that runs through the webserver), but in this case you would be looking for the file in wamp/bin/apache/apache2.x.y/bin/php.ini

XDebug is not detected by PHPstorm

I have Installed nginx and php-fpm, in order to load php codes from nginx, my page works fine, but now I want to run xdebug in order to debug my code.
I follow the steps from the manuals, I modified my php.ini inside from my php-fpm folder (that is a must) but as you can see in the picture my route to the fpm does does not appear, so it believe that XDebug is not installed, when really it is.
Open Settings->Languages & Frameworks->PHP
Open Settings->Languages & Frameworks->PHP
Thank you so much
I discovered the problem, PHP Storm is supposed to detect the debuggers if the configuration files is correct, BUT is importat to make sure that the firewall doesn't block the ports used.
To prove that I deactivated the firewall and now works fine.

disable php files caching for debugging

I have a vps with zpanel installed and apache2 - php - mysql.
I'm developing a small backend for a website in php, for sites ready to publish the situation is perfect, but now I need to disable the server feature that caches php files to test instantly the correct (last modified version) of my php files.
This is because while html and js files, when edited, are reloaded correctly immediately, with php I have a long wait before it updates or I have to restart the server.
I tried to open php.ini and look for "cache" and set to "1" millisecond almost all the values with no luck.
what could I try?
P.S. it's not a browser cache problem, that's a server side problem.
Solved: inside php.ini I added a line with
apc.enabled=0
after that I restarted apache2 and now php files are updated istantly as they should
thanks for the suggestion to look into phpinfo

Existing PHP sites on a CentOS server configured to use Apache are working, but new sites will not parse PHP

I have an issue with my CENTOS server. PHP will not parse. php -v shows that PHP 5.3 is installed.
Things I've tried:
Uninstalling httpd, and reinstalling it
uninstalling PHP and reinstalling it (php53u)
My http.conf contains the php directive lines required for PHP5, but it seems I have to enable these directive lines in my magento site .htaccess (1and1 related commented lines) to get any effect. When that happens, PHP files are no longer being downloaded, but the source is visible in my browser.
I did do a test trying to use an existing domain and point it to the new sites root directory, but the issue persists
I've looked around the internet for the answer and on Stack Overflow, my problem seems to be different than other users, because my original sites still work. The only sites I have a problem with are new sites.
Other things I've noticed:
Magento sites on the server are still running fine. If I create a new subdomain site, I get the same PHP will not parse error.
The existing sites DO NOT have the .htaccess php5/1and1 directive lines uncommented.
I did originally have an INNODB issue today on the server. I ended up having to rebuild some sites. The site with the rebuilt database is fine.
What could be the reason as to why existing sites work, even after uninstall and reinstall of php/apache, but new sites don't seem to be configured correctly on setup?
UPDATE:
New Things I've tried:
renamed /etc/php.ini. Original sites still work. New sites still show source. I guess this means that I have 2 php.ini files on the server somehow. After checking, I can only find one.
Enabling short tags in PHP
Other relevant information:
The server is currently at PHP 5.1.6. My sites that worked now correctly show a PHP version error message (Magento sites need 5.2+). The new sites are still not working. I'm also using Plesk.

Install and use PHP for IIS7: WINDOWS 7

I installed Apache, PHP and Apache to be used with PHP. The Apache server was never pointing to localhost, and the localhost always pointed to IIS instead of Apache.
Interestingly, I had a seperate website (explicitly named with somename.com, running locally with default port 80 and upon firing the Apache server the site was being used (instead of localhost) for displaying the Apache-based folders.
However, both are not able to process PHP and I've been trying to get this to work for almost a day now (I thought it wouldn't be too rough on me initially)
So since no matter what change I've made:
Apache configuration to use specific IP, rather than port 80.
Restricted IIS on specific ports, rather than port 80 and all local ports.
Disabled IIS via 'Services' in Administrative Tools.
Forced restart of 'Apache Service' via 'Services' in Administrative Tools (this threw an error). But restarting it via the Apache Http server menu options seemed to work fine.
Installed XAMPP so it will run directly (not sure if I'm using this wrong though, it did seem to start up but again localhost was never pointing to the Apache's 'htdocs' like it's supposed to.
PHP was added to Apache as well as downloaded (both .MSI, .ZIP installed for BOTH Apache and IIS).
No option seems to make the PHP process, it just displays the source code (like in HTML you have the html, head, body tags displayed on the web site instead of actual HTML ). It's pretty frustrating that:
After different attempts to disable IIS, I've not been able to.
Apache has everything configured to run PHP (I have actually done this on a Macbook once a long time back, don't remember if I missed anything though) but it doesn't work.
No errors are thrown, except that localhost is not displayed (I stopped the sites that were on IIS, and localhost points to IIS, any attempts at accessing either the IIS specific folders, or the Apache sites are not working).
Also, several attempts of getting PHP to work on WINDOWS 7 (yes in capital letters) has failed as well. Please help!!! Let me know if any specific details may help in troubleshooting, and I will be glad to provide them.
Well, firstly, apache is obviously now running as you can see the php source.
If you only see php source, assuming the PHP file is of a .php extension, you can boil it down to almost certainly the mime type hasnt been set.
in your apache config there will be lines such as:
AddType application/x-httpd-php .php
if not, add it.
If that doesnt work it would really seem it hasnt heard of PHP at all.
having not got apache on win7 to hand, theres probably a loadmodule line missing, while this is aimed at vista, this may have some ideas.
http://www.wikihow.com/Install-and-Configure-Php-5.2.5-and-Apache-2.2.8-in-Windows-Vista
Just use some prebuilt solution....
I use WAMP, But there are loads out there.

Categories