Mamp mac os php ini

MAMP Support Forums

Hi-
I’m a newb to MAMP and i have installed it successfully on a Mac M1 running Big Sur.

I am attempting to load table data exported from a client site into MySQL installed on my local machine. The problem is that the import into my local database fails with the following error:
>>
«No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See FAQ 1.16.»
Of course, i followed the FAQ and discovered that there’s at least 3 parameters to tweak here, the ones that i have tweaked in my php.ini file are as follows:
post_max_size = 256M
memory_limit = 512M
upload_max_filesize = 128M
(as i understand it, these have to have different sizes, with memory_limit being the largest)

The php.ini file that i have modified is in my /Applications/MAMP/bin/php/php7.4.12/conf directory.
I have then used the MAMP console to stop and restart the servers.

I then go to http://localhost:8888/MAMP/?language=English in my browser and go to the phpinfo section. I find the following info there:

PHP version: 7.4.12
post_max_size = 256M
memory_limit = 512M
***upload_max_filesize = 2M ***

The part immediately above is what i don’t understand. I’ve only changed one php.ini file using the above values. I don’t see how TWO out of the THREE values that i changed are reflected in the environment. True to form, when i go back into phpAdmin and into MySQL as above and try the import again, the max file size is listed on the import screen as «(Max: 2,048KiB)».

Читайте также:  Сетка конечных элементов python

I have NO idea why 2 of the three values that i’ve changed have their changes reflected in the environment, but the third is unchanged. I’m wondering if the source of it might be somewhere else that the upload_max_filesize variable? Can anybody help me thru the conundrum?

Источник

how to access php.ini in MAMP

I am trying to increase the file upload size for phpMyAdmin so I can import a SQL database. In order to do so I need to edit php.ini . However, I can’t find it on my computer. I am using MAMP on a Win 10 machine. Can someone show me how to do it?

This answer would help too. stackoverflow.com/a/68856119/4819200 You can update PHP.ini from File(menu) -> Open template -> PHP ->

3 Answers 3

You will probably find php.ini in

On my mac, running MAMP I have a few locations that would be the likely php.ini, so I edited the memory_limit to different values in the 2 suspected files, to test which one effected the actual MAMP PHP INFO page details. By doing that I was able to determine that this was the correct php.ini: /Applications/MAMP/bin/php/php7.2.10/conf/php.ini

Assuming MAMP uses same directory structure on PC, then it would just be the php(number) that would differ depending on what PHP is set in your MAMP Preferences.

MAMP keep its php.ini in the following location.

/Aplications/MAMP/conf/bin/php/****/conf/php.ini 

Linked

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.7.24.43543

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

How to enable and setup php.ini on a Mac with OSX 10.8 + (MAMP Part 4)

Mac MAMP server setup on your local computer

Welcome to part 4 of the MAMP tutorial. In this post we will go over setting up php.ini on your Mac’s localhost.

What green means: any lines that you need to replace in this tutorial will be in green.

1. Enable the php.ini file:

1. Using Terminal, copy the existing php.ini.default and rename it to php.ini

sudo cp /etc/php.ini.default /etc/php.ini

2. Open php.ini in nano in your terminal for editing

2. Enable php short tags:

A php script with short tags will not run on your server unless php short tags are enabled.

1. Hold ctrl + w to do a string search. Type “short_open_tag” to find the line. (You may need to search a couple times)

3. Disable detect_unicode:

detect_unicode is a deprecated feature and will be disabled in the future. But for now we need to disable it so it doesn’t cause us problems.

1. Go to the very end of the php.ini file (still open in nano) and add the following line to the end of the file. It doesn’t exist yet.

4. Set the timezone:

1. Hold ctrl + w to do a string search. Type “date.timezone” to find it.

UTC tells the server to use your local timezone.

Save the file and exit. and congrats. You are done!

Share this:

By Jonathan Whiting

I enjoy sharing what I am learning and hopefully it’s of interest and help to you. I live in Canada with my wife. Follow me on Twitter.

44 replies on “How to enable and setup php.ini on a Mac with OSX 10.8 + (MAMP Part 4)”

Thanks for the tutorial Jonathan 🙂

Thank Jonathan, all your work is amazing.

I want to upload large files using my phpMyAdmin… but it wont accept large files. Is there a way to edit the php.ini file that the phpMyAdmin is using to accept large files?

post_max_size=20M
upload_max_filesize=20M
max_execution_time = 300

I tried to change these in the /etc/php.ini but they were denied.

Hi Matt, Just to confirm did you restart apache after the update?

Yes thank you,
That was my issue. It needed a restart!

Awesome, I’ve done that before. Updated my settings, scratched my head and then remembered it needed to be restarted.

Thank you Jonathan. You saved my day. Much love from Jakarta! xoxo

Hi Tia, happy it worked out for you!

thank you from Japan for your running posts! very helpful.

Hi from Canada, I’m happy it helped you

Very nicely done. Very informative.

Wow. That was pretty straightforward. Very nicely done. Whew!

Thank you so much for making this available.

It would be nice if you could of explained better. Many users are new to commands and you don’t even tell us how to save this file. Now I’m left with a mess Thanks

Hi Steven, thanks for your feedback. I will try to make future tutorials easier to follow. Let me know if there was any specific commands that you would like explained?

Also I forgot to write that I followed these tuts on my 10.9 OSX worked great to easy!

Thank you Jonathan your tuts are faultless! you saved me time & a head ache as I’m a student in web development and very new to this world of programming. Cheers 🙂

I’ve followed your instructions and when I try to log into I get ” #1045 Cannot log in to the MySQL server”
the config.inc.php file is located here: “/Users/jim/Sites/phpMyAdmin”
the contents of the config.inc.php are:

ANY help or guidance you can provide is appreciated

You may need to change your host credentials from “localhost” to “127.0.0.1”

Let me know if that helped?

Thank you for this great series of articles. It has been very helpful. I think MAMP is a nice solution for beginners but after a while, they’ll look for this kind of native solutions.

Hi Kubilay, glad you found it useful and I couldn’t agree more. Mamp.info is a great solution to get started, but there are PHP packages that are required for some projects that don’t integrate nicely with it. Having a clean localhost setup is the way to go.

Ah this is THE tutorial that I didn’t have any trouble following it.
Many Thanks!

Glad you found it helpful

Great tutorial – much appreciated!

Very helpful, thanks a lot…I could finish my task.

Hello, I am going crazy with my mac because I am newbie with this system and I have discovered to differentes php.ini. One in my localhost with MAMP and other with my “internal” server. I am programming with Symfony and I need to write console command that they don’t work and my web application yes. How can i configure to set the same php.ini? Thanks in advance

I am sorry, but I don’t not understand your question? The php.ini setup will handle your mac’s server. There should only be one file running your mac’s Apache server.

Thanks for this tutorial. After hours searching internet and doing all weird I was able to setup the configuration. Can you please put up permissions tutorial on Sites folder. for eg joomla installation creates the configuration file through web and ask for deletion of the installation folder also. I wanted to know what would be ideal permission set in Sites folder.

Jonathan, I am running PHP version 5.3.15 and when I run phpinfo() on MAC OS X 10.8.4, it shows that my display_errors is OFF for both local and Master values. How do I change these values to ON? Any assistance would be greatly appreciated. I am new to the MAC world…I know how to change the php.ini file in windows but I am running MAC.

HI Edward, I wrote a quick tutorial to show you how to do this. It’s very easy. http://machiine.com/2013/how-to-turn-display_errors-to-on-in-php-ini-file/

Ok, I just did all this, many thanks…! However I don’t know why I did all these little things. Perhaps you could update the tutorials some time with comments (color orange or so) to each step on why we are doing things and learn from this…

Thanks, glad it helped. I try to make these tutorials easy to follow, those explanations make sense to add.

Jonathan, Followed your instruction and thanks for your assistance. One quick question, since I converted from Windows to Mac. In Windows, we are told to change the “SMTP = localhost” to our outgoing mail server and to change “sendmail_from = [email protected] ” to your email address. I noticed that in your instructions, you don’t mention this. Do I need to change those two lines to test mail applications on my local computer? Any assistance would be greatly appreciated. Thanks, Edward

It’s pretty straightforward to enable it. Just need to update a few config files. I will write a post with some instructions.

It’s not as straightforward as I first thought. As of 10.8 there are a bunch of changes that Apple made. I am documenting my progress and will post how I got it working, hopefully by tomorrow.

I am unable to loacte the default php.ini for php 5.3.15 that comes with mac to enable display errors and as I configured MAMP I could not configure php 5.4.10 or greater that comes with MAMP please help me

Hi Prabhu, the default php.ini file should be located at the following path. /etc/php.ini.default

Источник

Оцените статью