I am running MAMP PRO 2.1.1 on a MAC using OS 10.7.4 (Lion). How do I change the path to the configuration (php.ini) file so that it is the same as the path to the installed Configuration file?
The path to the php.ini used will be based on the version of PHP you have selected in MAMP. For example, with PHP 5.3.4 that would normally be:
/Applications/MAMP/conf/php5.4.3/php.ini
Assuming you haven't changed the defaults, you should be also be able to visit the MAMP info page:
http://localhost:8888/MAMP/
Select the "phpInfo" tab and look for the "Loaded Configuration File" setting.
Related
I cannot find the php.ini file or .htaccess file where I'm meant to change the max_input_vars to 5000 in my moodle website folder. I'm using mamp and myphpadmin
Moodle explains "To change max_input_vars you can either set it in php.ini or modify it in runtime, for example for Apache you can create .htaccess file: php_value max_input_vars 5000"
I searched in finder.
Create a test php file in the root of the Moodle folder with
<?php
phpinfo();
Then open it from the browser, not the command line (the command line and web server might use different versions of php)
eg: yourmoodlesite/test.php
This will display the location of the php.ini file that is being used, eg:
Loaded Configuration File /etc/php/7.4/apache2/php.ini
I haven't used MAMP, but the documentation says the php file can also be edited via the menu in MAMP PRO
File > Open Template > PHP > [PHP version] -> php.ini
It also says the location is
/Library/Application Support/appsolute/MAMP PRO/conf
https://documentation.mamp.info/en/MAMP-PRO-Mac/Menu/
in our install4j script we are using a prebuild jre. The tar.gz file contains a link for MacOS and Linux. When installing on linux, the link is kept. When installing on MacOS (in Version 8.0.8, it did work in 8.0.4), the link is replaced by a real file.
Contents/MacOS/libjli.dylib -> ../Home/jre/lib/jli/libjli.dylib
After installing, the file Contents/MacOS/libjli.dylib is not a link any more, but a real file. It seems that the Eclipse-launcher has a problem with this, it does not start with this error:
Error: could not find libjava.dylib
Failed to GetJREPath()
If the file Contents/MacOS/libjli.dylib is changed back to a link, the Eclipse-Launcher will start again.
I have a temporary solution in my setup.install4j script to remove that file and create a link (action for both exists), but it would be nice to to modify the links in the tar.gz of a prebuild jre.
To be able to fully sign and notarize a JDK bundle on macOS, the file Contents/MacOS/libjli.dylib cannot be a symlink.
See
https://bugs.openjdk.java.net/browse/JDK-8235687
These are new requirements from Apple that have been introduced by notarization.
However, recent JDK versions fix the problems introduced by that change:
https://bugs.openjdk.java.net/browse/JDK-8238225
Basically phpinfo says upload_max_filesize is 2M, but I changed it in the php.ini file to 8M. I am using MAMP, so I restarted MAMP and phpinfo still says 2M. I checked the path to the php.ini file that phpinfo shows and it matched up exactly. See the YouTube video of me documenting all of this.
You should change the file in /Applications/MAMP/bin/php/php5.4.10/conf/php.ini
After you should reset MAMP. I also changed all php.ini before, and phpinfo() doesn't had been change, but I don't sure if it is need to works, so if only changing the file in the path above, try change the others also.
I hope that help you.
On MAC os make sure you are at the right path:
/Applications/MAMP/bin/php/phpx.x.x/conf/php.ini
I see a lot of people had trouble with this since there is also another conf directory
To be sure, write a file with this PHP content:
<?php
phpInfo();
?>
and save it in your main MAMP document root (as any other web page) with name info.php
Open that file as a web URL in your browser as any other MAMP web page, as an example: http://127.0.0.1:8888/info.php
Search for the string: php.ini in that page.
You will find a line like this:
Configuration File (php.ini) Path /Applications/MAMP/bin/php/php7.2.8/conf
That line will show you the correct path for the ini file PHP is using in that moment. It depends on the PHP version you are using.
Delete (or rename with an unguessable name) the info.php file, after (avoid giving all this info to the world).
In httpd.conf file the PhpIniDir had the wrong path. It was off by one directory. That was the fix!
You can update PHP configurations using below:
File(menu) -> Open template -> PHP -> {select PHP version that you want update}
Source: http://blog-en.mamp.info/2009/09/increase-php-memory-limit-with-mamp-pro.html
MAMP PRO php config file is loaded from other path.
I found it after replace all php infos from mamp/bin/php/ directory without results.
/Applications/MAMP PRO/MAMP PRO.app/Contents/Resources/php(VERSION).ini
I have the same problem with MAMP (non pro), MAM is stopped
the current php version I am using is php7.2.20, I have changed everywhere in
/Applications/MAMP/bin/php/php7.2.20 and /Applications/MAMP/conf/php7.2.20
post_max_size = 128M
upload_max_filesize = 128M
I restart MAMP and I get php7.2.20
post_max_size = 8M
upload_max_filesize = 32M
I am trying to set up xdebug on mamp pro with no success. I searched all over the internet, nothing helped me.
First I have tried just to uncomment the following line in php.ini:
zend_extension="/Applications/MAMP/bin/php/php5.4.4/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
Next, I've tried the wizard:
http://xdebug.org/wizard.php
Next, I've tried adding these lines to php.ini:
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_autostart=1
Nothing helps. I can't see xdebug in my phpinfo.
MAMP PRO Version: 2.1.1
PHP Version: PHP 5.4.4
Thanks!
Since release of MAMP 2.01 XDebug is already included.
Solved. Here's the tutorial that helped me:
Start MAMP
Edit php.ini template file through MAMP to enable the extension. Edit the template file via File -> Edit Template -> PHP -> PHP php.ini
Edit bottom of php.ini template file so that it ends up looking like if you want profile output
[xdebug]
zend_extension="/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.profiler_enable = 1
xdebug.profiler_output_dir = "/tmp"
; DONT REMOVE: MAMP PRO php5.3.6.ini template compatibility version: 1
If you don’t want profile output and just want xdebug running then use
[xdebug]
zend_extension="/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.profiler_enable = 0
xdebug.profiler_output_dir = "/tmp"
; DONT REMOVE: MAMP PRO php5.3.6.ini template compatibility version: 1
Now when you have errors, if they are sent to standard out, you will see something like this
My php.ini file:
Save edited template and close edit window
Restart MAMP
Open MAMP’s WebStart page and navigate to PHPInfo tab. Check to make sure that Xdebug is running. Doing a search in the browser window for “Xdebug” makes this easy.
If you used the same settings that I have above, when you run PHP code, Xdebug will put the cachegrind.out files in your ‘/tmp’ directory. Open your ‘/temp’ directory and run one of your PHP files to make sure it is working correctly. You can open the ‘/tmp’ directory in finder by opening the terminal and running
open /tmp
Now you can use any app that understands those cachegrind.out files to view the profile data. Apps like KCacheGrind (Linux/Windows, KDE), WinCacheGrind (Windows), xdebugtoolkit, and Webgrind. I went the simple route and used webgrind. Webgrind is a simple web based application that you can run locally on MAMP and it will look for the cachegrind.out files automatically with just one click. Continue for steps on setting up with webgrind.
Download Webgrind
Setup Webgrind host on MAMP to run Webgrind
Visit webgrind url setup on your local MAMP installation. Mine was simply webgrind/
If you already have cachegrind output files you should be able to select the file in the “Auto (newest)” dropdown or leave it select at Auto and click update which will reveal the profile data
Throw a celebratory fist pump
I had trouble with setting up MAMP Pro and nginx myself and the above answer did not work for me.
The problem was that the default port setting is 9000, which in my case I have that port already in use so I looked in my nginx conf at this line:
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/Applications/MAMP/Library/logs/fastcgi/nginxFastCGI.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
then go to the file located when fastcgi_pass is set to, and in there you will find the correct port number. In my case it was in Applications/MAMP/Library/logs/fastcgi and the filename is dependent on your host's php version.
Then open that file, and set whatever PID is in there to xdebug.remote_port in php.ini, for me it was 13267.
It may be worthwhile to mention my MAMP config for PHP is set to CGI mode, not modules.
EDIT:
I just realized that the port number dynamically changes way too much. So I set a hardcoded value for fastcgi pass in my nginx template for MAMP like so:
fastcgi_pass 127.0.0.1:9072;
# comment out the regular setting just in case.
# fastcgi_pass unix:/Applications/MAMP/Library/logs/fastcgi/nginxFastCGI.sock;
I install :
netbeans 6.9 on 'C:\Program
Files\NetBeans 6.9'
xampp 1.7.2 on D:\xampp
i have upgrade zend through pear
I follow the screencast and when clicking the Register Provider button. But I get message like this:
on create config tab
Successfully written Zend Tool config.
It is located at: \Documents and Settings\Permana/.zf.ini
on enable.config.provider NetbeansCommandsProvider
User has no config file.
An Error Has Occurred
Client has no persistent configuration.
Zend Framework Command Line Console Tool v1.10.7
Details for action "Enable" and provider "Config"
zf enable config.manifest class-name
zf enable config.provider class-name
And of course because of this error I cannot create zend project using netbeans. Did anyone know what is the problem?
Windows XP:
Make sure the environment variable ZF_HOME is set.
I found the soltution to this problem. Just delete the /home/username/.zf.ini and go to netbeans and register zendframework provider again. This will generate zf.ini file in your home directory with new path.
Yesterday I had the same problema. I wrote a post in my blog:
http://otroblogmas.com/error-zend-tool-netbeanscommandsprovider-php/
I found two solutions: either modify the file zf.ini in your profile, or copy the file NetBeansCommandsProvider.php in a path of include_path.
Ubuntu 10.10, NetBeans 6.9.1, Zend Framework 1.11
Reconfigurar
Edit PHP.ini
include_path = ".:/opt/lampp/etc/library" ; Files "/opt/lampp/etc/library/Zend"
gedit /etc/profile
export PATH=$PATH:/opt/lampp/bin # Includer zf.php and zf.sh
export PATH=$PATH:/opt/lampp/etc/library
Remove zf.ini and register NetBeans provider again (from Tools > Options > PHP > Zend).
The above answers are correct, however in my case there was no zf.ini file under my user directory (using Windows 7). In that case you need to run two commands:
zf --setup storage-directory
zf --setup config-file
That will create your zf.ini file and the storage directory under your user directory. Source: here