Uncategorized

May 14, 2024

(adsbygoogle = window.adsbygoogle || []).push({}); As a developer, managing PHP modules on your Ubuntu system can be an essential part of your workflow. Modules are packages that extend the functionality of PHP, and they are a key aspect of creating dynamic and powerful web applications. This article provides a comprehensive guide on enabling and disabling PHP modules in Ubuntu, streamlining your experience and optimizing your development environment. All the installed PHP modules configuration files are available under /etc/php/{php_version}/mods-available directory. You can see the number of files with extension .ini. You must have installed specific PHP modules, you need to enable before using this tutorial. The php-common package provides followings commands to manage PHP modules. Advertisement#main_svContainer{background-color:#e9e9e9;width:100%;display:flex;align-items:center;justify-content:center}@media (min-width: 320px){#mainContainer{position:relative;padding-bottom:5px;width:200px !important;height:112px !important}#content,#adContainer{position:absolute;top:0px;left:0px;width:200px;height:112px}#contentElement{width:200px;height:112px;overflow:hidden}}@media (min-width: 481px){#mainContainer{width:200px !important;height:112px !important;position:relative;padding-bottom:5px}#content,#adContainer{position:absolute;top:0px;left:0px;width:200px;height:112px}#contentElement{width:200px;height:112px;overflow:hidden}}@media (min-width: 641px){#mainContainer{width:300px !important;height:169px !important;position:relative;padding-bottom:5px}#content,#adContainer{position:absolute;top:0px;left:0px;width:300px;height:169px}#contentElement{width:300px;height:169px;overflow:hidden}}@media (min-width: 961px){#mainContainer{width:420px !important;height:180px !important}#content,#adContainer{position:absolute;top:0px;left:0px;width:480px;height:220px}#contentElement{width:480px;height:220px;overflow:hidden}}@media (min-width: 1025px){#mainContainer{width:480px !important;height:220px !important;position:relative;padding-bottom:5px}#content,#adContainer{position:absolute;width:480px;height:220px}#contentElement{width:480px;height:220px;overflow:hidden}}@media (min-width: 1281px){#mainContainer{width:480px !important;height:220px !important;position:relative;padding-bottom:5px}#content,#adContainer{position:absolute;top:0px;left:0px;width:480px;height:220px}#contentElement{width:480px;height:220px;overflow:hidden}}#sv-footer-element{position:absolute;width:100% !important;bottom:0;height:40px !important;background:linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.5) 100%);display:flex;flex-direction:row;justify-content:space-between;align-items:center}.sv-controls-container{display:inline-block;padding:12px;cursor:pointer}.sv-controls{width:25px;height:25px}.sv-controls-container .sv-volume-mute{content:url(“data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAAAsTAAALEwEAmpwYAAADLUlEQVR4nO2cS27TUBhGfyiCMVsAUUCAQEDVrogtMGUFCCQeC4ABDJAqKgQTHnsA1gAT4u+LeZfqoivdTKoktZ1r/7bzHcmjKtfJOX4k9q3NhBBCCCGEEEIIIYQQQggxjxDC8bl/EO0C4BaArwB+k3wO4LScdwTJOyTDoeWpAvjJDyShAH7yQ1wUwFE+FcBXPhXAVz4VwFc+FcBXPhXAVz4VwFc+FcBXPhXAVz4VwFc+FcBXPhXAVz5rBgghHGvwlnszfu/ks2KAoiiukXwD4BeAPwD2ptPphVyfazqdXgSwG6/OxnXEdU0mk6s2dvmsECDJL+e8tiC5neFzbaexDo9f9iZCW/JZIUDcGpe8HqtESPKxZPzXNmb5PCJAvHecDgkhd4QK8kNcd/bzQlmWVwDcB/CJ5Pc25TLDHgDgZ4VxakWoIj8tPywXIYRTJB8BOPCWznoBdiuOVSlCDflxD3iRU/47b9lsFuDsgpNk7Qh15Md1AjiTJQDJx96i2TBAA3FzI+QYY5Vj/sGQA6wq0E1+JJ5wvSUzQ4BIURTXSX6rIXIHwA2SExf5KcDnsQRouDX7bPkzFvyK7M1iDai5J/jJj3gLZgsBMkdoT35krAEyRWhXfmTMAVaM0L78yNgDNIzQjfzIOgRAva+aswA71gVjD4D68ruNMOYAaC6/uwhjDYDV5XcTYYw/xJBPfvsRdCmCvpciANwbyx6ABhfWmlzAyxqgLMvLAP4NPQCHejk6vYGHQw7AId+QiYQQTpJ8O8QAJM973ZIkuZk7woO+HY7sCAC8crwpv2e5KcvyEoC7AD724SuqLSGEsBGnIuaSXzdCmhfk+1wLALcdA5wAsJ9T/owq344A/I0bga3z1EQAH3LLr7EnvLd1n5wLYGvB9MRWJ+emmdg3rU94TU8HsBW3xng4io+6AfCS5LmMn2sznnDT2PtpXf2S35N/0Nho86QYx+7FMb/LE7MJ3wgmfPcEE74RTPhGMOEbwYRvBBO+EUz4RjDhG8GEbwQTvhFMtA/16OJ+RgDwxPt9rePj67+kGyzP9Ph6J4L3jW4hhBBCCCGEEEIIIYQQwgbFf0hFT0LOGMLcAAAAAElFTkSuQmCC”);height:30px}.sv-controls-container .sv-volume-un-mute{content:url(“data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAAAsTAAALEwEAmpwYAAAEo0lEQVR4nO2dT6hVRRzHp2xRkJG7UkjU/izKTZvShZFCLQpqm0GQrfpDFiVRKOhCN6GgIJjpohZBBS4NsoiCEl5Bz4yMNoq1ebzXne/3nHsow5qYOA/iMb/zPPeeOeeeub8PzG5m7tzf9/z5zcxvfscYRVEURVEURVEURVEURVEUpWfMzc3dDOBFAKcAnCX5MclnnHMruh5b8mRZ9hDJSyRdoHxbFMXqrseYLAC2A7giGH+xnHPO3dT1WJOD5E4Afy9j/MXyctfjTQbn3PUADl+j4RfLTNfjTgLn3I3lC9bVLFnXY+89AFYB+HIE4/9Xuh5/rymKYrV/mY5qfBVgDPI8v4/k5XGMrwKMiLV2K0mMa/ymBPAOgJkWcG0+fisCWGu3AfjJ9wPgR2vtwyZlSO4C8E9Txh9HgMFgsJZksaS/obV2nUkNN5qPH1UAkq+G+gNwwqSEG93HjyoAgJcEAf7yd4dJyMf/KpbxxxGgKIo13thCv0dM3yka8PFjv4QBvCf0my0sLNxipt3HZ2QB/Dglp8A/osy0+/iMLIAHwGmh73OmbbwfTPI4gAveJWvLiOxQgPI/B/v2d4hpAwAbSH7etTHZgQAekrNC/wea6H+5H98MYKFrQ7JhAcpZ7g/lrHuG5AMVNngt1DeAn03sK7/PxqcgAID1gVmuHQ6Ht4XqD4fD2wFcFURYH02Avj52uLwAbwj190m2APB1q95Q6a24FAUg+bpQ/1cppAXAm0Kbj6II4L2d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W0ECshUkIFtBArIVJCBbQQKyFSQgW0ECshUkIFtBArIVJCBbQQKyFSQgW0ECshUkIFtBArIVJCBbQQKyFSQgW0ECshUkIFtBArIVJCBbQQKyFSQgW0ECshUkIFtBArIVJCBbQQKyFSQgW0ECshUkIFtBArIVJCBbQQKyFSQgW0ECshUkIFtBArIVJCBbQQKyFSQgW0ECshUkIFtBArIVJCBbQQJiZmZmZmZmZmZmZmZ2lnYDATSZmYIL48kAAAAASUVORK5CYII=”);height:30px}#sv-close-floater-button{margin-left:auto;width:50px;background:black;content:url(“data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAABIElEQVR4nO2Z3Q4BMRBGy7sLF0K44AbvKH5ujzS7QljWtp3pSOY8wPQ73f5MsyE4juM4UgAT4ASsgLHiuGNgDZyBaU6hIw/2GhI04eNYd445xeZPhcQleA8fmecUHAGbl4IHCQmasbbFJ0xDAqnwGhJIh5eUQCu8hIR6+JIS1cKXkKgePkfCTPgUCXPhh0iYDf+LhPnwd9qwu46gr73Nzlz4ni9he+YHSNgPH/mw5t829r+Fty9B92OkaxPbW0p8OSo1H0VJ/HLOm5VgwCVlToKEG9aMBBntQXUJCvQ21SQo2JipSyDQVaIlIdkSIy2h0c8jJaH5GEFCAlhqhO/ppxYhFeCqFf6LxCWkAsxigTgLFX5wLNqx039wOI7jOKGHG/HkCQoy1hroAAAAAElFTkSuQmCC”);margin:unset}.sv-show{display:flex}.sv-hide{display:none}.floater_sv{position:fixed !important;bottom:1rem !important;right:-5rem !important;height:unset !important;overflow:unset !important;z-index:99999999999999 !important;transform:scale(0.4)}.close-floater{width:100%;margin-top:-50px;cursor:pointer} let vast_sound = “vpmute=1&”; let adsManager; let adsLoader; let adDisplayContainer; let intervalTimer; let isAdPlaying; let isContentFinished; let videoContent; let is_ads_playing = 0; let is_play_pause = 0; let is_volume = 0; let video_content_pause = 0; let pause_by_user = 0; let isSVTabActive = true; let request_height = 0; let request_width = 0; let sv_is_floater_active = 0; let sv_is_floater_closed = null; let check_sv_once = 0; document.getElementById(‘contentElement’).muted = true; document.body.addEventListener(‘click’, () => { document.getElementById(‘contentElement’).muted = false; if (document.getElementById(‘contentElement’).readyState == 4) { vast_sound = “vpmute=0&plcmt=1&”; if (check_sv_once == 0) { is_volume = 1; document.getElementById(“sv-sound-toggle”).className = “sv-volume-un-mute”; check_sv_once = 1; } else { } } else { document.getElementById(‘contentElement’).muted = true; console.log(“Not ready”); } }); function init() { videoContent = document.getElementById(‘contentElement’); playButton = document.getElementById(‘playButton’); setUpIMA(); } function setUpIMA() { var offsetHeight = document.getElementById(‘mainContainer’).offsetHeight; document.getElementById(‘main_svContainer’).style.height = offsetHeight + “px”; var element = document.getElementById(‘mainContainer’); request_height = element.offsetHeight; request_width = element.offsetWidth; createAdDisplayContainer(); adsLoader = new google.ima.AdsLoader(adDisplayContainer); adsLoader.addEventListener( google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, onAdsManagerLoaded, false); adsLoader.addEventListener( google.ima.AdErrorEvent.Type.AD_ERROR, onAdError, false); const contentEndedListener = function () { if (isAdPlaying) return; isContentFinished = true; videoContent.play(); isContentFinished = false; video_content_pause = 0; adsLoader.contentComplete(); }; videoContent.onended = contentEndedListener; const adsRequest = new google.ima.AdsRequest(); let cb = Math.floor(Math.random() * 1000000000); let encodedURL = encodeURIComponent(window.location.href); adsRequest.adTagUrl = “https://pubads.g.doubleclick.net/gampad/ads?iu=/106213651,22672464595/Tecadmin_Freefont_Vast_Video&description_url=”+encodedURL+”&tfcd=0&npa=0&sz=1×1%7C400x300%7C640x480&gdfp_req=1&unviewed_position_start=1&output=vast&env=vp&impl=s&”+vast_sound+”correlator=”+cb+”&hl=en”; adsRequest.vastLoadTimeout = 10000; adsRequest.linearAdSlotWidth = 640; adsRequest.linearAdSlotHeight = 400; adsRequest.nonLinearAdSlotWidth = 640; adsRequest.nonLinearAdSlotHeight = 150; adsLoader.requestAds(adsRequest); } function createAdDisplayContainer() { adDisplayContainer = new google.ima.AdDisplayContainer( document.getElementById(‘adContainer’), videoContent); } function playAds() { videoContent.load(); adDisplayContainer.initialize(); try { adsManager.init(request_width, request_height, google.ima.ViewMode.NORMAL); adsManager.start(); } catch (adError) { videoContent.play(); } } function onAdsManagerLoaded(adsManagerLoadedEvent) { const adsRenderingSettings = new google.ima.AdsRenderingSettings(); adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete = true; adsManager = adsManagerLoadedEvent.getAdsManager(videoContent, adsRenderingSettings); adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, onAdError); adsManager.addEventListener( google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED, onContentPauseRequested); adsManager.addEventListener( google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED, onContentResumeRequested); adsManager.addEventListener( google.ima.AdEvent.Type.ALL_ADS_COMPLETED, onAdEvent); adsManager.addEventListener(google.ima.AdEvent.Type.LOADED, onAdEvent); adsManager.addEventListener(google.ima.AdEvent.Type.STARTED, onAdEvent); adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE, onAdEvent); if (videoContent.muted) { console.log(“VIDEO MUTED”); adsManager.setVolume(0); is_volume = 0; document.getElementById(“sv-sound-toggle”).className = “sv-volume-mute”; } else { console.log(“VIDEO NOT MUTED”); adsManager.setVolume(0.01); is_volume = 1; document.getElementById(“sv-sound-toggle”).className = “sv-volume-un-mute”; } adDisplayContainer.initialize(); try { adsManager.init(request_width, request_height, google.ima.ViewMode.NORMAL); adsManager.start(); } catch (adError) { } } function onAdEvent(adEvent) { const ad = adEvent.getAd(); switch (adEvent.type) { case google.ima.AdEvent.Type.LOADED: if (!ad.isLinear()) { videoContent.play(); } break; case google.ima.AdEvent.Type.STARTED: is_ads_playing = 1; if (ad.isLinear()) { intervalTimer = setInterval( function () { }, 300); // every 300ms } break; case google.ima.AdEvent.Type.COMPLETE: if (ad.isLinear()) { clearInterval(intervalTimer); } is_ads_playing = 0; break; } } function onAdError(adErrorEvent) { try { adsManager.destroy(); } catch (adError) { } } function onContentPauseRequested() { isAdPlaying = true; videoContent.pause(); video_content_pause = 1; } function onContentResumeRequested() { isAdPlaying = false; video_content_pause = 0; if (!isContentFinished) { videoContent.play(); } var el = document.getElementById(‘adContainer’); // el.removeChild(el.firstChild); while (el.firstChild) { el.removeChild(el.lastChild); } } function playPause(isDocumenthidden, clicked_by_user) { if (clicked_by_user === 1 && isDocumenthidden === 0) { if (isAdPlaying && pause_by_user === 0) { adsManager.pause(); is_play_pause = 0; document.getElementById(“sv-play-toggle”).className = “sv-play”; pause_by_user = 1; } else if (isAdPlaying && pause_by_user === 1) { adsManager.resume(); is_play_pause = 1; document.getElementById(“sv-play-toggle”).className = “sv-pause”; pause_by_user = 0; } else if (!isAdPlaying && pause_by_user === 0) { videoContent.pause(); document.getElementById(“sv-play-toggle”).className = “sv-play”; pause_by_user = 1; } else if (!isAdPlaying && pause_by_user === 1) { videoContent.play(); document.getElementById(“sv-play-toggle”).className = “sv-pause”; pause_by_user = 0; } } else if (isDocumenthidden === 1) { if (isAdPlaying && pause_by_user === 0) { adsManager.pause(); is_play_pause = 0; document.getElementById(“sv-play-toggle”).className = “sv-play”; pause_by_user = 0; } else if (!isAdPlaying && pause_by_user === 0) { try { videoContent.pause(); document.getElementById(“sv-play-toggle”).className = “sv-play”; pause_by_user = 0; } catch (Error) { } } } else if (isDocumenthidden === 0) { } } function muteUnmute() { if (is_volume === 1) { is_volume = 0; try { adsManager.setVolume(0); vast_sound = “vpmute=1&”; } catch (adError) { } document.getElementById(“sv-sound-toggle”).className = “sv-volume-mute”; videoContent.muted = true; vast_sound = “vpmute=1&”; } else { is_volume = 1; try { adsManager.setVolume(0.01); vast_sound = “vpmute=0&plcmt=1&”; } catch (adError) { } vast_sound = “vpmute=0&plcmt=1&”; document.getElementById(“sv-sound-toggle”).className = “sv-volume-un-mute”; videoContent.muted = false; } } const options = { root: null, rootMargin: ‘0px’, threshold: 0.5 }; const first_sv_observer = new IntersectionObserver((entries, observer) => { entries.forEach(entry => { if (entry.isIntersecting) { observer.unobserve(entry.target); var GIMASdkScript = document.createElement(“script”); GIMASdkScript.type = “text/javascript”; GIMASdkScript.onload = function () { videoContent = document.getElementById(‘contentElement’); playButton = document.getElementById(‘playButton’); setUpIMA(); playAds(); sv_is_floater_closed = 0; }; GIMASdkScript.src = “https://imasdk.googleapis.com/js/sdkloader/ima3.js”; document.getElementsByTagName(“head”)[0].appendChild(GIMASdkScript); setInterval(function () { if (!isAdPlaying) { if(isSVTabActive){ setUpIMA(); } } }, 2000); } else { } }); }, options); const targetElement = document.querySelector(‘#mainContainer’); first_sv_observer.observe(targetElement); setInterval(function () { window.onfocus = function () { isSVTabActive = true; if (isSVTabActive === true) { if (sv_is_floater_closed === 1) { } else { if (isAdPlaying && pause_by_user === 0) { adsManager.resume(); play_pause = 1; document.getElementById(“sv-play-toggle”).className = “sv-pause”; } else if (!isAdPlaying && pause_by_user === 0 && video_content_pause === 1) { videoContent.play(); document.getElementById(“sv-play-toggle”).className = “sv-pause”; } } } }; window.onblur = function () { isSVTabActive = false; if (isSVTabActive === false) { if (isAdPlaying) { adsManager.pause(); play_pause = 0; document.getElementById(“sv-play-toggle”).className = “sv-play”; } else if (!isAdPlaying && pause_by_user === 0 && video_content_pause === 0) { try { videoContent.pause(); document.getElementById(“sv-play-toggle”).className = “sv-play”; pause_by_user = 0; video_content_pause = 1; } catch (Error) { } } } }; }, 1000); const second_sv_observer = new IntersectionObserver((entries, observer) => { entries.forEach(entry => { if (entry.isIntersecting) { if (sv_is_floater_closed === 0) { document.getElementById(“mainContainer”).className = “”; sv_is_floater_active = 0; document.getElementById(“close-floater”).classList.remove(“sv-show”); document.getElementById(“close-floater”).classList.add(“sv-hide”); } else { if (isAdPlaying && pause_by_user === 0) { adsManager.resume(); is_play_pause = 1; document.getElementById(“sv-play-toggle”).className = “sv-pause”; pause_by_user = 0; } else if (!isAdPlaying && video_content_pause === 1) { videoContent.play(); document.getElementById(“sv-play-toggle”).className = “sv-pause”; pause_by_user = 0; } } } else { if (sv_is_floater_closed === 0) { document.getElementById(“mainContainer”).className = “floater_sv”; sv_is_floater_active = 1; document.getElementById(“close-floater”).classList.add(“sv-show”); document.getElementById(“close-floater”).classList.remove(“sv-hide”); } else { if (isAdPlaying && pause_by_user === 0) { adsManager.pause(); is_play_pause = 0; document.getElementById(“sv-play-toggle”).className = “sv-play”; pause_by_user = 0; } else if (!isAdPlaying && pause_by_user === 0) { try { videoContent.pause(); document.getElementById(“sv-play-toggle”).className = “sv-play”; pause_by_user = 0; video_content_pause = 1; } catch (Error) { } } } } }); }, options); document.addEventListener(‘scroll’, function () { const targetElementFirst = document.querySelector(‘#main_svContainer’); second_sv_observer.observe(targetElementFirst); }, { passive: true }); top.document.getElementById(‘close-floater’).onclick = function (evt) { document.getElementById(“mainContainer”).className = “”; sv_is_floater_closed = 1; sv_is_floater_active = 0; video_content_pause = 0; document.getElementById(“close-floater”).classList.remove(“sv-show”); document.getElementById(“close-floater”).classList.add(“sv-hide”); if (isAdPlaying) { adsManager.pause(); play_pause = 0; document.getElementById(“sv-play-toggle”).className = “sv-play”; } else if (!isAdPlaying) { videoContent.pause(); document.getElementById(“sv-play-toggle”).className = “sv-play”; pause_by_user = 0; } is_volume = 0; adsManager.setVolume(0); document.getElementById(“sv-sound-toggle”).className = “sv-volume-mute”; videoContent.muted = true; }; phpenmod – Used to enable modules in PHP phpdismod – Used to disable modules in PHP phpquery – Used to view status of modules of PHP There are 3 types of SAPI (Server API) available – CLI, FPM, and Apache2 being the most commonly used. You can define SAPI using -s switch to enable/disable module for that only. Enabling PHP Modules on Your System PHP modules enhance the functionality of your PHP installations, allowing for a more versatile development environment. The phpenmod command is a utility that simplifies the process of enabling these modules across different PHP versions and Server API (SAPI) environments. This guide provides detailed instructions on using phpenmod to enable PHP modules effectively. 1. Basic Command to Enable PHP Modules To enable a PHP module, the basic syntax of the phpenmod command is as follows: phpenmod MODULE_NAME For instance, to enable the mbstring module, which is essential for handling multibyte string functions in PHP, you would use: phpenmod mbstring This command enables the mbstring module for all installed PHP versions and all SAPIs on your system. 2. Specifying PHP Versions If you wish to enable a module for a specific PHP version, the phpenmod command can be modified using the -v switch followed by the version number. This is particularly useful when different projects on the same system require different PHP versions. Syntax phpenmod -v <PHP VERSION> <MODULE NAME> Examples To enable the mbstring module specifically for PHP 8.2 and 7.4, the commands would be: phpenmod -v 8.2 mbstring phpenmod -v 7.4 mbstring These commands ensure that the mbstring module is enabled only for the specified PHP versions. 3. Targeting Specific Server APIs (SAPI) The -s switch allows you to specify the SAPI type for which you want to enable the module. This feature is helpful when you need to enable a module for specific server environments such as CLI, FPM, or Apache2. Syntax phpenmod -s <SAPI> <MODULE NAME> Examples To enable the mbstring module for different SAPIs, use the following commands: For Command Line Interface (CLI): phpenmod -s cli mbstring For FastCGI Process Manager (FPM): phpenmod -s fpm mbstring For Apache 2: phpenmod -s apache2 mbstring These commands activate the mbstring module specifically for the chosen SAPI environments, ensuring that your PHP configuration is optimized for your development and deployment needs. 4. Combining PHP Version and SAPI For even more precise module management, you can specify both the PHP version and the SAPI when enabling a module. This approach provides the most granular control, allowing you to target specific combinations of PHP versions and server environments. Example: To enable the mbstring module for PHP 7.4 running under the FPM SAPI, the command would be: phpenmod -v 7.4 -s fpm mbstring This command ensures that the mbstring module is enabled only for PHP 7.4 with FPM, making it a powerful tool for fine-tuning your PHP environment. Disabling PHP Modules You can also disable any un-necessary PHP modules from your system using phpdismod command. For example, disable mbstring module for ALL PHP versions and all SAPI. phpdismod mbstring To disable any module for a specific PHP version use the command below. phpdismod -v 8.2 mbstring To disable any module for specific SAPI on all PHP versions, use the command below. phpdismod -s apache2 mbstring Restarting the Web Server Once you have enabled or disabled a PHP module, you need to restart your web server for the changes to take effect. Depending on your web server, you can use the following commands: For Apache: sudo systemctl restart apache2 For Nginx with PHP-FPM: sudo systemctl restart php8.x-fpm sudo systemctl restart nginx Replace 8.x with your PHP version (e.g., php8.2-fpm). Verify PHP Module Status After restarting the web server, you can verify if a PHP module is enabled or disabled by running the following command: php -m | grep <module-name> If the command returns the module name, it is enabled. Otherwise, the module is disabled. Conclusion Managing PHP modules on your Ubuntu system is a crucial part of optimizing your development environment. By following this guide, you can now easily enable and disable PHP modules on your Ubuntu system. Remember to restart your web server after making changes to ensure the new settings take effect. With this knowledge in hand, you’re now ready to enhance your PHP development experience on Ubuntu.

As a developer, managing PHP modules on your Ubuntu system can be an essential part of your workflow. Modules are packages that…

Read More…

April 27, 2024

How to delete an array element based on key in PHP?

Given an array (One dimensional or multidimensional) and the task is to delete an array element based on key value. Examples: Input:…

Read More…

April 25, 2024

Unfreeze stucked “freezed” messages from Exim Mail server queue

Messages are frozen when the mail server has determined it cannot do anything to deliver the message. (they can also be manually…

Read More…

March 29, 2024

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!…

Read More…