MAMP can't incresse phpmyadmin upload limit - upload

I'm using MAMP 3.0.3 and have phpmyadmin 4.1.9 installed. I have changed the php.ini files in all locations within: /Applications/MAMP/bin/php/php5.X.X/conf to all have:
post_max_size = 200M
upload_max_filesize = 200M
max_input_time = 600
memory_limit = 256M
When I restart the server the limit still remains at 32M. Even in MAMPs webstart page it says 32M.
I've updated both reported php.ini files that its loading too:
Configuration File (php.ini) Path: /Applications/MAMP/bin/php/php5.3.28/conf
Loaded Configuration File: /Library/Application Support/appsolute/MAMP PRO/conf/php.ini
Nothing's working.

The phpMyAdmin application has a configuration file that overwrites the PHP settings. Check your apps/phpmyadmin/conf/httpd-app.conf.
There you will find these lines:
php_value upload_max_filesize 32M
php_value post_max_size 32M
Just increase them and the UX should allow you to upload bigger files.

I tried this for version 4.x MAMP Pro. The file in described folder doesn't exist in the MAMP folder but a php.ini too and at the end it is overwritten every time you run Server again.
So in MAMP Pro you can choose on the left "PHP" and than on top next to the selected PHP-Version click the arrow. It opens the standard configuration in an editor. Change your settings close and then you will be asked to save.

Related

Fatal error: Allowed memory size exhausted after MAMP update

I know this question can be found a lot of time on this forum and the internet. But I can't seem to find the answer to my specific question.
I'm running a Drupal website, and since the update of MAMP from 5.5 to 5.6 I get the following error:
Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) when running a composer require in the terminal.
I updated the php.ini tot 1024MB instead of 128MB of the current php version I'm running via MAMP. When I add a php file to my root with <?php phpinfo(); ?> I see that the memory is like I want so 1024MB. When I look at the location of the php ini file I see it is in the MAMP folder.
But I still get the error. When I run this php -r "echo ini_get('memory_limit').PHP_EOL;" in my terminal I see the 128MB again. When I try to find the php ini that is running using
php -i|grep 'php.ini' I get:
Configuration File (php.ini) Path => /etc
So it looks like the php.ini file is somewhere else. But I don't know where and can't change it. How can I solve this?
I also tried changing the composer memory using php -d memory_limit=-1 /usr/bin/composer but this didn't solve the problem either.
My question is, how can I solve this problem? How can I find the php.ini file that is used. Or how can I change the memory limit?
Update:
Running php -i | grep 'Configuration File' in the terminal ouputs:
Loaded Configuration File => (none)
And maybe good to know that I have the option Make this version available for command line enabled on the MAMP php section.
I tried many of the suggestions on this and a few other stack overflow questions but couldn't get it to work until I tried:
COMPOSER_MEMORY_LIMIT=-1 composer require 'yourpackagenamehere'
Just trying COMPOSER_MEMORY_LIMIT=-1 by itself before running the command didn't seem to work. Not sure why, but I had to run them on the same command line in a similar way as documented in the composer troubleshooting: https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors
I ended up adding a php.ini file to the /etc folder on my computer. This way the php memory_limit raise did work. And checking it in the terminal did show me the right value. But as Alister already said, this didn't fix the problem. The problem was not in the php.ini memory_limit.
I found out that using COMPOSER_MEMORY_LIMIT=-1 in the terminal at the beginning of my session put the memory limit to unlimited during that terminal session. This fixed the problem.
After that I added, alias composer="COMPOSER_MEMORY_LIMIT=-1 composer" to my bash file and know everything is working like I would expect.
Changing the amount of memory in php.ini won't help - that is the limit for what is being used by the webserver's version of PHP - and having too much available for the webserver can cause problems (at least when running in production).
Composer, when it is being run from the command line, will, by default set the limit to 1,610,612,736 bytes - 1.5 GB.
As you are apparently still on PHP 5.6, that's also a very considerable problem. PHP 7+ is a great deal more efficient with memory, as would be an up to date version of composer.
Finally, to actually solve the problem: Restrict your requirement to be more specific since that keeps memory usage lower.

Wampserver sql dump

I know this has been asked many times before. But I am getting a:
The mbstring extension is missing. Please check your PHP configuration.
First off I am using WanmpServer3.0.0 64 on a Win7 64 VM.
-I tried editing the php.ini file to give an absolute path to no avail
-made sure that the extension=phpmbstring.dll is uncommented
Another problem is that i noticed that whenever i load a php page it has fatal errors for my mysql commands.
When I use the wampmanager from the tray to open the php.ini file instead of through windows explorer I get:
Cannot find the C:\wamp64\bin\apache\apache2.4.17\bin\php.ini file. Do you want to create a new file?
So now I'm thinking something has gone drastically wrong and would like to uninstall/reinstall Wamp. I attempt to use the mysql console to save my databases before deleting the wamp directory. However when I run a mysqldump -all-databases > all_database.sql it just drops down to an empty line and nothing happens.
mysql console screenshot
If I browse around in the C:\wamp64 directory i find the "data" directory within \bin\mysql where it seems all of my databases reside but not in readable form.
Is there anyway to save my databases??
BTW: This whole setup was working fine previously, so I'm not sure what caused the crash and burn.
Was able to figure it out.
I opened the php.ini file from the PHP bin folder and copied all of the contents into a new php.ini file to reside in the apache bin file.
Now everything works again.
I'm not sure this is how wampserver is supposed to work or what changed to start the problem but it's pseudo-resolved now.

WAMP server startup error: "No tray icon was specified"

I get an error when I try to load WAMP Server:
The configuration file contains a syntax error on line 0; [EParseError] No tray icon was specified. Please assign a tray icon by using on the of the Trayicon directives in the [Config] section.
What am I supposed to do? It won't load WAMPServer.
Go to the wamp/scripts folder
Open console
run: php refresh.php
This should recreate wampmanager.ini
(requires wampmanager.tpl file in wamp folder.
Taken from http://sourceforge.net/p/wampserver/feature-requests/10/#750b)
Tested only in wampserver 2.4.
Working wampserver 3.2.3 as well
Answered in:
How to repair wamp server without re-installing?
Same thing happened to me after a Windows update. Some of the solutions above haven't worked for me (as of 2017) but here's what solved it without having to reinstall Wamp.
Head over to WampServer's repo, scroll down to "Tools" and download wampmanager.ini repair. Run the .exe, open wampini_repair.bat, and you're golden!
I also encountered the same error some-times ago and the fix was so simple.
Take note of the wamp server version you installed.
The fix:
Rename the current wamp folder under C:/wamp to wamp2
Install a new instance of the same wamp on the C: drive
Copy the wampmanager INI file from the new installation (C:/wamp) into the old folder (C:/wamp2)
Delete the new wamp folder
Rename the old folder from wamp2 to wamp
Startup your wamp server, and see the magic.
Remember to say thanks !
The problem is in wampmanager.ini.
Check if the above file is empty, if so adding the following code will work
[Config]
ImageList=images_off.bmp
ServiceCheckInterval=1
ServiceGlyphRunning=13
ServiceGlyphPaused=14
ServiceGlyphStopped=15
TrayIconAllRunning=16
TrayIconSomeRunning=17
TrayIconNoneRunning=18
ID={wampserver}
AboutHeader=WAMP5
AboutVersion=Version 2.2
[AboutText]
WampServer Version 2.2
Maintainer / Upgrade / Roadmap by Herve Leclerc (herve.leclerc#alterway.fr)
Powered by Alter Way [www.alterway.fr]
Sources are available at SourceForge
[www.wampserver.com]
[Services]
Name: wampapache
Name: wampmysqld
[Messages]
AllRunningHint=WAMP5 - All services running - server Offline
SomeRunningHint=WAMP5 - %n of %t services running - server Offline
NoneRunningHint=WAMP5 - None of %t services running - server Offline
[StartupAction]
Action: run; FileName: "c:/wamp/bin/php/php5.5.12/php-win.exe";Parameters: "refresh.php";WorkingDir: "c:/wamp/scripts"; Flags: waituntilterminated
Action: resetservices
Action: readconfig;
Action: service; Service: wampapache; ServiceAction: startresume; Flags: ignoreerrors
Action: service; Service: wampmysqld; ServiceAction: startresume; Flags: ignoreerrors
Add the correct path to php-win.exe. (change the php5.5.12 to your installed version)
The easiest way is to install the same version of WAMP to a with the same folder structure to a different partition ( if you don't have an extra partition use external drive). For example, if your current WAMP, which causes you the error is in C:/wamp64, install the duplicate in D:/wamp64.
After that copying process, the content of the wampmanager.ini from the new installation and replace to wampmanager.ini of the old installation ( open the file with Notepad, delete the existing stuff and replace it with the copied content).
Then replace the drive letter with the old drive letter (i.e D:/wamp64 with C:/wamp64 ) and save the file. ( you will have two lines to change this letter).
That is it. You are ready and good to go.
Enjoy!!
Tested with wamp64 version 3.0 and it works fine.
First take the backup of all the folders from c:\wamp folder then reinstall wamp.
Copy the files named wampmanager.exe and wampmanager.conf from c:\wamp files (Files from Backup) to the folder c:\wamp you will be asked to replace the existing files, do it. Then Start WAMP Server. The problem is fixed.
If you do it, your project files will not lose.
I had this issue and solved it by going into the wamp64 folder and simply running wampmanager.ini.repair . This opened a version of wamp where only 2 of 3 services were running, but I exited out of that and ran wamp again as administrator, and it started working.
I faced the similar issue and got the fix. You just have to search for the file name wampmanager.ini in the WAMP server installation and replace the file content with the following content. Be sure to put the correct directory path.
[Config]
ImageList=images_off.bmp
ServiceCheckInterval=1
ServiceGlyphRunning=13
ServiceGlyphPaused=14
ServiceGlyphStopped=15
TrayIconAllRunning=16
TrayIconSomeRunning=17
TrayIconNoneRunning=18
ID={wampserver}
AboutHeader=WAMP5
AboutVersion=Version 2.2
[AboutText]
WampServer Version 2.2
Maintainer / Upgrade / Roadmap by Herve Leclerc (herve.leclerc#alterway.fr)
Powered by Alter Way [www.alterway.fr]
Sources are available at SourceForge
[www.wampserver.com]
[Services]
Name: wampapache
Name: wampmysqld
[Messages]
AllRunningHint=WAMP5 - All services running - server Offline
SomeRunningHint=WAMP5 - %n of %t services running - server Offline
NoneRunningHint=WAMP5 - None of %t services running - server Offline
[StartupAction]
Action: run; FileName: "c:/wamp/bin/php/php5.4.3/php-win.exe";Parameters: "refresh.php";WorkingDir: "c:/wamp/scripts"; Flags: waituntilterminated
Action: resetservices
Action: readconfig;
Action: service; Service: wampapache; ServiceAction: startresume; Flags: ignoreerrors
Action: service; Service: wampmysqld; ServiceAction: startresume; Flags: ignoreerrors

Is it possible to change the url called by WAMP?

When click 1 and/or 2 WAMP open the web without my configured IP
i.e.
1 open http://localhost/, I need localhost:8080
2 open http://localhost:8080/phpmyadmin/, I need localhost:8080
Is it possible to add the port in WAMP's configuration somewhere? Currently I add it manually.
Thanks to JK suggestion I've try and found that in wampmanager.tpl file, search for localhost will expose the marked-red area which help to add the port.
Navigate to your WAMP installation folder and locate the files wampmanager.ini and wampmanager.tpl. Replace all occurrences of localhost with localhost:8080 within these two files. Restart wampserver.
Actually, #JK, the wampmanager.tpl is the template file used (by wampmanager.exe during start up) to generate wampmanager.ini. So you only need to edit the .tpl file and that solves it.
*TIP: You can also add custom menus to your wamp tray icon by adding entries to the wampmanager.tpl file.
Edit the file C:\wamp64\wampmanager.conf and change the port:
[apache]
apachePortUsed = "8080"
Then exit and relaunch wamp.

PHP.ini overriding/not allowing set_ini or set_include_path directives

I'm not exactly sure why this is happening. I'm running MAMP on my local machine. And I decided to install PEAR locally. So I edited the PHP.ini file and uncommented the include_path directive. Now for some reason none of my ini_set or set_include path directives work:
// trying to different methods
ini_set( 'include_path', ini_get( 'include_path' ) . PATH_SEPARATOR . BASE_PATH . "Zend/library/" );
set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH . "Zend/library/" );
Here's my php.ini directive:
include_path = ".:/Applications/MAMP/bin/php5/lib/php:/usr/local/PEAR"
If I comment that out then my code works. Any thoughts?
I had a similar problem using WAMP on my PC at work. I can't be certain if it is the same, but looking at the MAMP download page, it might well be.
I edited the php.ini files but the changes weren't taking effect. After a little bit of tinkering, I found out that when the services start, they don't use the ini files in their expected locations. Modifying the php.ini file made no effect. However, when I clicked the WAMP system icon, and chose the Modify PHP.ini option, it opened a new php.ini file in notepad - which I was able to Save but surprisingly not Save As. This leads me to understand that the ini files for WAMP, and quite likely MAMP are dynamically created on the fly and not using the files that are stored physically in the folder structure.

Resources