I try to update my php to 8.0 using homebrew. The update worked fine. The “php -v” shows that the actual version is 8.0.14. However when I open my localhost and go to “phpinfo.php” it shows the old version 7.4.22. Obviously my server still uses the old one. How to fix this? How to update the server version. I saw several post about similar problem, but the solutions offered didn’t work for me… I’m using Mac.
Thanks
So after long searching I finally found this step-by-step tutorial.
https://getgrav.org/blog/macos-monterey-apache-multiple-php-versions
What I did:
I added apache to my server;
I added php to my server (now I no longer need XAMPP);
I followed the step by step configuration to connect apache to php (through updates in httpd.conf file).
Related
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
I am trying to install PHP on my IIS web server running version 7.0. I downloaded the php-7.1.8 Non Thread Safe for Windows 64. I then procceded to follow the steps found here: https://www.howtogeek.com/50432/how-to-install-php-on-iis-7-for-windows-server-2008/.
I had no issues with the install but when it came to the last step of creating the test PHP page and launching, instead of getting the results, i'm being asked to Open or save the file??
I've also tried putting this into a live website and accessing it outside the web server. When I try this I receive a 500 - Internal Server Error.
I had tried this about a year or two ago and got frustrated, so I gave up and have retried today but experiencing about the same result. Don't know what other information would help, but i'm willing to provide what's necessary. Thank you for any help.
After continuing research I ended up using the Windows Installer version (https://www.microsoft.com/web/platform/phponwindows.aspx) and then went back through the configuration steps of the php.ini file.
I spent some hours trying to solve a migration from CentOS 5.5 to 7 in which everything worked except PHP-based sites connecting to the MySQL server for a Web site. Perl worked fine. CLI commands worked fine. I tried every solution listed on Stack Overflow and elsewhere:
Make sure /etc/hosts contains localhost as the first entry for 127.0.0.1
Check that PHP is correctly pointing to the right socket
Try swapping localhost and 127.0.0.1 in the connection setup
Checked php.ini for any settings that differed between my functional CentOS 5.5 setup and the new stock CentOS 7 installation.
Annoyingly, I couldn't get PHP to dump errors, whether via Apache or elsewhere. It was all maddening.
After checking for the fifth time that I had the right drivers installed, I realized that there are two CentOS/yum packages: one is php-mysql; the other is php-mysqlnd, a native driver.
Uninstalling php-mysql, which is apparently outdated, but which is what I used in CentOS 5.5, and installed php-mysqlnd instantly fixed the problem.
I have been unable to find any other answers of this sort, so perhaps my situation is unique. But I wanted to document it in case someone else came across the same migration issue.
This is my issue and it has given me sleepless night.
I have been working on the wamp 2.1 server environment for the past 3 years and now i want to upgrade. I finally installed wamp 2.5 and would be willing to keep my previous wamp 2.1 version. everything looks good, because after installation, i did the following after:
Copied ?:\wamp_old\bin\apache to ?:\wamp\bin
Copied ?:\wamp_old\bin\mysql to ?:\wamp\bin
Copied ?:\wamp_old\bin\php to ?:\wamp\bin
Now, the issue is this:
Whenever i start the wamp server with the latest version, it works and the icon turns green. but whenever i try changing/switching back to the old version, all the services starts except the Apache. the icon stays orange and never turns green. whenever i click test port, it tells me your port 80 is not actually used. when i click on install service, i get this message: your port 80 is available, install will proceed. when i select remove service, it removes immediately. when i click start/resume service, nothing happens and it never starts.
What I want to achieve is this:
Some old joomla site were developed on the former wamp 2.1 and each time i tried accessing them via the new wamp 2.5, i see some deprecated functions and it display some chunks of codes. meanwhile, i have two projects that refuse to run on the old wamp 2.1, so i decided to run the 2.5. Presently, the system has wamp 2.5 running.
For 5 days now, i have been cracking my head and i have been stucked.. someone out there should please help me with a solution to run wamp 2.1 and wamp 2.5 together so i can switch version easily. or a probably solution will be appreciated.
Kind Regards !
You were on the right track copying the old Apache MySQL and PHP folders into the new 2.5 version.
Unfortunately switching to very old versions from the new ones is now a bit more hassle than it used to be because of the changes made in the version of compiler used to compile Apache and PHP.
Your old versions of Apache and PHP were compiled with MSVC6 and the new versions with MSVC11 and the 2 are not compatible i.e. an Apache compiled with VC11 wont run with a PHP compiled with VC6 etc.
So try this :-
Switch from Apache 2.4.9 to your old version, it wont start because the PHP version will still be 5.5.12.
Ignore the problem.
Now switch to an old version of PHP, thats compatible with the old Apache.
With luck it will now work.
Check you have the correct version by looking at phpinfo
If it does not come up re-do the switch to the old apache and then again to the old PHP by just re-clicking the version numbers on the relevant switch menu.
To be honest I don't know if it would be possible to restore everything to work fine. I had once similar problems - I had Wampserver and installed new PHP version for WAMP and switched to new PHP version and eveything stopped to work. I tried to change PHP version to the previous one but I had info it's not compatible with Apache and I couldn't change PHP version because of chosen PHP version.
Now I moved to easyPHP and it's much more easier, you can have many PHP versions, there's no problem with changing them.
Probably in your case the problem was not WAMP itself but PHP versions. That's why when you launched your older code you have many warnings. You should simple select older PHP version to do that or you simple have to turn off warning (maybe for other PHP version you had turned off displaying warnings by default?).
If I were you, I would move to easyPHP, dump your databases (if any) and move everything to easyPHP. Probably you won't make your installation of WAMPserver work so the other option is backup everything, dump your databases and reinstall WAMPserver but you can be almost sure similar problem occurs sooner or later when you will be switching between PHP versions.
After alot of brainstorming, I finally resolved the issue all by myself.
Though it may not look wise, but i believe it could go a long way to help others who are stucked in situations like this.
First, I started the wamp 2.5, changed all the versions to the latest ones, which is Apache, Mysql and Php... when the icon turned green, I decided to stop all services, uninstalled the services one after the other. (Apache and mysql) and exit the application by right clicking.
Secondly, I renamed the wamp which encapsulates the 2.5 version to wamp_2.5old and renamed the 2.1 folder back to wamp. i launched the wamp and installed the services back again..this time, it was a lower version. both php and apache had just one version while my sql had two. I made sure the right version of sql was selected and i installed it. I restarted all the services, the icon turned green and all my old website worked.
I tried the method vice-versa and all my latest projects worked. it might look challenging but thats my own way of discovering running multiple version of wamp.
Lastly, thanks to Özgür Eroğlu and Marcin Nabiałek.. they have been of helped.
Pleas help me flag this as useful for research..
vielen gluck.. good luck guys !
I recently installed Windows 7 on my desktop and the following problem has begun occuring:
I regularly run some PHP scripts from the commandline that are now giving this error in a popup window:
CLI has stopped working.
I cancel this and my script terminates. Not good...
I've googled around and tried most of the few ideas suggested but still i am plagued by this annoyance. Right now it appears to regularly occur when I do a file_get_contents() of a url pointing to an image file. Only happens when the url is http protocol, works fine for ftp files. It also happens spuriously doing other things as well.
This is PHP 5.3.0 as distributed in a xampp 1.7.2 .zip. All exe's and dll's have been unblocked by copying thru FAT32 and back.
hints from anyone who's cracked this would be most helpful.
Try updating your PHP version bundled with xampp. You might have to update some php_XXX.dll extension files.
More info: http://web2.0entrepreneur.com/31/cli-has-stopped-working-on-windows-vista.html
PHP-CLI stops under these circumstances: Windows 7 64bit, PHP 5.6.8 64bit, only when Zend OpCache extension is ENABLED!!!
Just edit php.ini and comment zend_extension=php_opcache.dll (with ; in front of it)
I found that this happened to me when I had the APC extension enabled. I switched to using the Wincache for PHP extension instead.
If you receive this error after installing WAMP, most likely you have another installation of PHP on your machine. This may have been installed using the Microsoft Web Platform Installer or by other means. The first thing you should do is un-install PHP.
If this doesn't work, check to make sure that IIS and Apache are not trying to use the same port. WAMP starts out with Port 80 as standard and IIS usually will be the same. The easiest way to fix this is to turn off IIS while running WAMP, but you can set either of them servers to port 81 or another port.
If this doesn't work, my last suggest is to look for multiple copies of php.ini on your machine. You may find them in places like the Windows directory. Make a backup of the file just in case, and then remove them from all of the folders except the WAMP folder.
it happened to me in laravel 5.I searched every where but no solution that fix my problem then i debug my web application at different points and found that if you comment your php code in laravel comments in blade template like
{{--print_r($date_a);--}}
Now comment like this
//print_r($date_a);
works
The solution for me was to stop using PHP 5.3.0 and go back to 5.2.11. Once I did this the "CLI has stopped working" issue disappeared.
I have the same issue with Windows 7 Professional.
My Apache Server has no problem finding and executing PHP within my web application but the command line execution gives the infamous message "CLI has stopped working."
The User Account Settings seem to allow executions.
Perl has no problem.
I always have to take my code to an XP machine and run it there to debug it.
You didn't specify that you were using xdebug, but just in case you were, I may be able to help. I had this error for a long time. It turned out I was on a slightly older version of Xdebug (php_xdebug-2.2.0-5.4-vc9.dll).
I replaced that file with "php_xdebug-2.2.2-5.4-vc9.dll" and it magically started working immediately.
I'm on wamp, and I updated both php.ini files (one is for cli, one for normal use) with the latest filename.
"zend_extension = c:\wamp\bin\php\php5.4.3\ext\php_xdebug-2.2.2-5.4-vc9.dll"
Then dropped the new file into the php ext folder and instant success.
I had the same issue on Windows 7 (Home premium). I had a hunch that it is caused by one of the extensions I installed so I started commenting them out one-by-one.
Turned out it was caused by a non-compatible mongodb extension I was using
Edit php.ini and comment zend_extension=opcache.enable_cli=1 (with ; in front of it)
Try to use another php version instead.
It works perfectly for me.
Try to run scripts with php-cgi.exe instead of php.exe. For me it works.