Is it possible to make changes in mysql's my.ini file using PHP script?
Sure - it's just a text file.
However, you would have to locate the correct INI file, stop the mySQL service, make the change, and start the service again. That's going to be tough. Your PHP script would probably need root privileges to stop and restart the service, and a PHP script should never have root privileges.
Update: A combination of these should work:
PHP commands to change the file: (enter www.php.net/commandname to be redirected to the manual)
fopen()
fwrite
fclose
PHP command to execute an external command:
exec()
Windows commands to stop and restart a service: net stop
/ net start
As to how to locate the my.ini programmatically, I have no idea. If you can, set that manually.
Assuming the user PHP runs as has permissions to edit that file, then yes.
The question is more why do you need to edit the my.ini file with a php script?
Since it is a regular file, you can open it with PHP file handling functions and make any change you want, if you have the right permissions on the file.