php.ini resetting on MAMP server restart - mamp

I am trying to change display_errors = Off to display_errors = On in my php.ini. I ran phpinfo() and verified the Loaded Configuration File (it is located here: /Library/Application Support/appsolute/MAMP PRO/conf/php.ini).
Everytime I edit the display_errors value of this php.ini file and restart my MAMP server, the php.ini file seems to reset. If I open the php.ini file again after restarting MAMP it shows display_errors = Off.
Why might MAMP be resetting the php.ini file?
note - I'm using MAMP Pro if that makes a difference.

The way I have done it was to change the template that MAMP Pro replaces your php.ini file with. In my case the ini file that PHP was loading was found at
/Library/Application Support/appsolute/MAMP PRO/conf/php.ini
but everytime I changed it, MAMP Pro wrote over it with its own version. To change what I wanted to change in the php.ini file, I simply found the template:
/Applications/MAMP PRO/MAMP PRO.app/Contents/Resources/php5.4.4.ini
(PHP 5.4.4 is the version i'm using) and then I changed what I needed to change :D Hope this helps

You can set php.ini values with the template editor in Mamp Pro.
File -> Edit Template -> PHP (php.ini)
Select the same version your instance is running.
When you save the template Mamp will overwrite the php.ini file used for your instance and restart Apache.

I finally figured it out. MAMP Pro works differently than regular MAMP. With regular MAMP you would edit the appropriate php.ini file directly. With MAMP Pro however you have to use the MAMP Pro interface to control the php.ini settings. MAMP Pro recreates the php.ini file each time the server starts based on these settings.
In my case, to display server errors I had to open the MAMP Pro interface. Click on the Server tab. Click on the PHP tab. Check the Display startup errors checkbox. Check the All errors and warnings checkbox. Check the Display checkbox. Apply the changes and restart the server.

Related

Eclipse XDebug stuck on 78%

i try to setup eclipse in order to debug my joomla web app.
I'm using MAMP on local machine, with php 5.6.10.
php.ini has these line:
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
When try to start debug on Eclipse, the progress bar stuck on 78%:
Waiting for XDebug.
How i can fix this problem?
Change the remote host to
xdebug.remote_host=IP_ADDRESS
try to enable multihost debugging using this
xdebug.remote_connect_back=1
Also check if your IDE is set in php.ini file
xdebug.idekey=ECLIPSE_DBGP
For further help you can check this link https://xdebug.org/docs/remote

MAMP avoid index file opening by default

Just a quick question concerning MAMP.
When going through the hard drive through the "localhost command" in my browser, upon opening a folder which contains a index.html file, how to stay in file browsing mode without it rendering the index file right away? Its a fresh MAMP install, the only setting I made was redefine my "Username/Sites" folder as localhost.
Locate following line in httpd.conf in your MAMP folder:
DirectoryIndex index.html index.php
Remove index.html and restart MAMP.
See also: http://httpd.apache.org/docs/current/mod/mod_dir.html#directoryindex

Editing netbeans.config to set jdk path results in an error

Hi I recently upgraded to windows 8.
For some reason after I installed netbeans it did not point to my instalation of jdk.
I had this problem before under windows 7 and I modified the path by editing the netbeans.config file.
I tryed to do the same thing but for some reason when I try to save the file in notepad++ I get an error stating that the file is opened in another program.
I tryed doing the same with wordpad an there I got the error that access is denied.
I restarted my computer two times same problem still persists.
Is there any other way of setting the path for the jdk?Maybe from any of netbeans option?
i was trying to this but that didn't work for me cause i need privileges..
My solution:
Just open notepadd++ as Admin and then you can do whatever you want..
If that doesn't work, delete the file and then create a new one with the same content(don't forget to run notepad++ as admin)
copy the content of netbeans.confg
delete it
create new file with the same name
past and perform your edit
Make shure netbeans isn't open when you edit the config file.
If setting of netbeans_jdkhome in the netbeans.conf doesn't work, you can outcomment it (insert a # before). Now netbeans will use the default JDK installed. However, you a proper path for java is required (and JAVA_HOME).
Its also possible to set the JDK by commandline argument: --jdkhome <dir>
See:
Setting JDK by command line
Netbeans.conf - see JDK part

Eclipse hangs when installing new software

I am trying to install new software within Eclipse the C++ version. Help -> install new software. When I go to install new software, it hangs or takes hours to move a percentage.
I have read that this is a known bug in JRE7, which I am assuming I am using since I have it installed. I changed to JRE6 by changing the eclipse.ini file with the argument -vm XXXX where XXXX is the path to my javaw.exe.
It does not seem to have changed anything.
Ideas?
Thanks.
Finally it worked for me only by unchecking Contact all update sites during install to find required software. From what I'm seeing it might be a Mac issue, on Windows and Linux it worked without any change.
You can get rid of this problem by simply disabling your Firewall software before installing new plugin. If your Antivirus has built-in Firewall, you need to disable it.
Optionally, to reduce the update time, you can uncheck Contact all update sites during install to find required software, see my blog post for details.
I've found it helps by adding this line to the eclipse.ini file:
-Djava.net.preferIPv4Stack=true
To install new plugin into eclipse, you can download plugin installer or go market place to install.
Make sure what SDK you are using and fill the correct path.
Wish you success
To get around this issue, I went to Windows->preferences->general->network settings and typed in each repository manually. I also selected manual from the drop down at the top of the window.
It seems it was also useful to get off of my home network and I had to get on another network.
I kept having this issue and resolved it by following Nitin Kale's fix for Eclipse slowness on fresh 16.04 here> https://askubuntu.com/a/788826
open terminal and type following command
export SWT_GTK3=0 add this to your ~/.profile file to make it
persistent across logins (you'll need to logout and log back in to be
able to start eclipse from shortcut)
then go to your eclipse folder and search for eclipse.ini file Right
click anywhere in the folder and choose "open in terminal" and type
following command in terminal
sudo gedit eclipse.ini and add the following line before
--launcher.appendVmargs
--launcher.GTK_version 2 Search in the file for 256 and replace it with 1024
I had to go to Preferences -> General -> Network Connection and set Active provider to 'direct' as it was 'native' by default. Then it worked fine.
None of above methods worked for me in Ubuntu 16.04 LTS and Eclipse Mars. Had to do following
Go to "Preferences"->"Install/Update"->"Available Software Sites" and uncheck all except "Mars".
After this install worked in a jiffy.
I solved my issue by following all steps in above answers
Window -> Prefrerences -> Install/Update -> Available Software Sites and then uncheck all except Your package name ( neon, mars ).
Window -> Prefrerences -> General -> Network Connections and set Active provider to "manual".
Help -> Install new Software -> uncheck "contact all update sites during install".
If anyone is still having this issue simply go to windows defender and add the installation app as an exception.

How to debug PHP with netbeans and Xdebug in Windows?

I have installed PHP using wamp server in Windows and I have give the entry for Xdebug in php.ini And Debugging not working in netbeans. How to solve this?
Thanks
If you are using wamp server in windows, make sure you edit the correct php.ini file (open php.ini FROM WAMP TRAY MENU) or check the path to your used php.ini file in phpinfo().
The path to your dll file looks like it might be wrong. Under WAMP it would normally point to something like
zend_extension_ts="C:\wamp\bin\php\php5.2.11\ext\php_xdebug-2.0.5-5.2.dll"
Is Xdebug showing up in when you call phpinfo?
<?php
echo phpinfo();
If not, then you don't have it correctly installed, and I would check both the php error log and apache.
Also, do you have the correct configuration in your php.ini for xdebug - such as the ports, id/key, etc?
I answered this here but I thought this was worth re-posting since so many Windows users are having problems after getting all the configuration right.
In my case it was a process running on my machine (Windows 7) that was using port 9000 already called aeagent.exe
I changed my php.ini setting to "xdebug.remote_port=9001", made the corresponding change in netbeans, then restarted Apache. Now it works.
Thanks to SysInternals TCPView tool.