The optional module, intl, is not installed, or has been disabled.

If you are using ubuntu you can take update

$ sudo apt-get update

And install extension in case of php 5.6

$ sudo apt-get install php5.6-intl

And in case of php 7.0

$ sudo apt-get install php7.0-intl

And in case of php 8.1

$ sudo apt-get install php8.1-intl

And restart your apache after

$ sudo service apache2 restart

And restart your nginx after

$ sudo systemctl restart nginx

If you are using xampp then remove semicolon ( ; ) in xampp/php/php.ini from below line

 ;extension=php_intl.dll

how to install imagemagick in ubuntu / php

The optional module, imagick, is not installed, or has been disabled.

$ sudo apt update
$ sudo apt install php php-common gcc
$ sudo apt install imagemagick
$ sudo apt install php7.4-imagick //install for specific php version
$ sudo apt install php-imagick //always install for latest php version
$ sudo systemctl restart apache2

Aws, DigitalOcean hosted website not working properly

1. Aws, DigitalOcean hosted website not browsing properly
2. Aws, DigitalOcean hosted website not working properly
3. Website not working properly on VodaFone hotspot
4. Website not working properly on VodaFone IP Address

Aws, DigitalOcean पर hosted कुछ वेबसाइट नही खुल रहा है

update wordpress 6.1 manually ftp

Replace WordPress files

  1. Get the latest WordPress zip (or tar.gz) file.
  2. Unpack the zip file that you downloaded.
  3. Deactivate plugins.
  4. Delete the old wp-includes and wp-admin directories on your web host (through your FTP or shell access).
  5. Using FTP or your shell access, upload the new wp-includes and wp-admin directories to your web host, in place of the previously deleted directories.
  6. Upload the individual files from the new wp-content folder to your existing wp-content folder, overwriting existing files. Do NOT delete your existing wp-content folder. Do NOT delete any files or folders in your existing wp-content directory (except for the one being overwritten by new files).
  7. Upload all new loose files from the root directory of the new version to your existing WordPress root directory.

NOTE – you should replace all the old WordPress files with the new ones in the wp-includes and wp-admin directories and sub-directories, and in the root directory (such as index.phpwp-login.php and so on). Don’t worry – your wp-config.php will be safe.

Be careful when you come to copying the wp-content directory. You should make sure that you only copy the files from inside this directory, rather than replacing your entire wp-content directory. This is where your themes and plugins live, so you will want to keep them. If you have customized the default or classic themes without renaming them, make sure not to overwrite those files, otherwise you will lose your changes. (Though you might want to compare them for new features or fixes..)

Lastly you should take a look at the wp-config-sample.php file, to see if any new settings have been introduced that you might want to add to your own wp-config.php.

zip all files and folders including hidden

How to use zip command in ubuntu, Linux, Unix

below command include all hidden files.

# zip 1.zip * .[^.]*
$ sudo zip 1.zip * .[^.]*

zip all files and folders including subfolder and hidden files

# zip -r 1.zip your_folder/.

To ignore a folder when using the zip command, utilize the -x option for exclusion.

Here is the general syntax:

Code

zip -r archive_name.zip source_directory -x "source_directory/folder_to_ignore/*"

Explanation:

  • zip -r: This initiates the zip command with recursive inclusion, meaning it will include all subdirectories and files within the source_directory.
  • archive_name.zip: This is the name you want to give your resulting zip file.
  • source_directory: This is the main directory you are zipping.
  • -x: This is the exclude option.
  • "source_directory/folder_to_ignore/*": This specifies the folder to be excluded.
    • source_directory/folder_to_ignore/: This provides the full path to the folder you wish to exclude, relative to the source_directory.
    • *: This wildcard ensures that all contents within folder_to_ignore are also excluded.
    • Quotes ("): Using quotes around the exclusion pattern is important, especially if the path contains spaces or special characters, to prevent the shell from interpreting them.

Example:

To zip a directory named my_project and exclude a subfolder named node_modules:

Code

zip -r my_project_archive.zip my_project -x "my_project/node_modules/*"

Excluding multiple folders:

You can specify multiple folders to exclude by adding more -x options:

Code

zip -r my_project_archive.zip my_project -x "my_project/node_modules/*" -x "my_project/logs/*"

Excluding folders by name (regardless of path):

To exclude any folder with a specific name, regardless of its location within the source directory, you can use a wildcard at the beginning:

Code

zip -r my_project_archive.zip my_project -x "*/node_modules/*"

This would exclude any node_modules folder found within my_project or any of its subdirectories.

when ipv4 not detected aws hosted website not working

Short description

To troubleshoot why your Amazon EC2 can’t access the internet, do the following:

  • Verify that the EC2 instance meets all prerequisites.
  • Verify that the instance has a public IP address.
  • Verify that a firewall isn’t blocking the access.

Resolution

Verify that the instance meets all prerequisites

The instance must meet the following conditions:

  • The route table that’s associated with your instance’s subnet has a default route to an internet gateway (0.0.0.0/0).
  • The internet gateway that’s associated with the route isn’t deleted.
  • The security group that’s attached to the instance’s elastic network interface has rules allowing outbound internet traffic (0.0.0.0/0) for your ports and protocols.
  • The network access control list (network ACL) that is associated with the instance’s subnet has rules allowing both outbound and inbound traffic to the internet.

Verify that the instance has a public IP address

If the instance in a public subnet doesn’t have a public IP address, then the instance isn’t accessible outside the virtual private cloud (VPC) where it resides in. This is true even if the instance has an internet gateway.

To allow the instance connectivity to the internet, allocate an Elastic IP address, and then associate this Elastic IP address with the instance.

Verify that a firewall isn’t blocking access

If the instance meets the preceding conditions and internet connectivity issues persist, then you might have a local firewall running in the operating system. It’s a best practice to use security groups instead of having a local firewall in the operating system. Be sure that disabling the local firewall doesn’t impact your workload.

# For Uncomplicated Firewall
sudo ufw disable

# For firewalld
sudo systemctl disable firewalld --now

If you must use a firewall, then the internet connectivity issues are usually related to the OUTPUT chain. You can allow outgoing traffic by running the following commands:

sudo iptables -P OUTPUT ACCEPT
sudo iptables -I OUTPUT 1 -j ACCEPT

Windows Server:

For Windows Server default firewalls, run the following command:

netsh advfirewall firewall show rule name=all

source

drag and drop folder upload JavaScript with php

<!-- Drag Drop Upload Code -->

<p>Drag files and/or directories to the box below!</p>

<div id="dropzone">
  <div id="boxtitle">
    Drop Files Here
  </div>
</div>

<h2>Directory tree:</h2>

<ul id="listing"></ul>

<script>
var dropzone = document.getElementById("dropzone");
var listing = document.getElementById("listing");

function scanAndLogFiles(item, container) {
  var elem = document.createElement("li");
  elem.innerHTML = item.name;
  container.appendChild(elem);
  if (item.isDirectory) {
    console.log('DIR '+item.webkitRelativePath);
  }
  if (item.isFile) {
    console.log('FILE '+item.webkitRelativePath);
  }
  if (item.isDirectory) {
    var directoryReader = item.createReader();
    var directoryContainer = document.createElement("ul");
    container.appendChild(directoryContainer);

    directoryReader.readEntries(function(entries) {
      entries.forEach(function(entry) {
        scanAndLogFiles(entry, directoryContainer);
      });
    });
  }
}

dropzone.addEventListener(
  "dragover",
  function(event) {
    event.preventDefault();
  },
  false
);

dropzone.addEventListener(
  "drop",
  function(event) {
    var items = event.dataTransfer.items;

    event.preventDefault();
    listing.innerHTML = "";

    for (var i = 0; i < items.length; i++) {
      var item = items[i].webkitGetAsEntry();

      if (item) {
        scanAndLogFiles(item, listing);
      }
    }
  },
  false
);
</script>
<style>
#dropzone {
  text-align: center;
  width: 300px;
  height: 100px;
  margin: 10px;
  padding: 10px;
  border: 4px dashed red;
  border-radius: 10px;
}

#boxtitle {
  display: table-cell;
  vertical-align: middle;
  text-align: center;
  color: black;
  font: bold 2em "Arial", sans-serif;
  width: 300px;
  height: 100px;
}
</style>

DataTables Tricks

Example 1


 $(document).ready(function() {

  $( "#selectType" ).change(function() {
  $('#example_filter input[type="search"]').val($(this).val()).keyup();
});

$('#example').DataTable( {
/*  "aoColumnDefs": [
      { 'bSortable': false, 'aTargets': [ 0 ] }
   ]*/
   "columnDefs": [
    { "orderable": false, "targets": [1] },
    { 'searchable'  : false, 'targets' : [9] 
},
    
],
"order": [[ 1, "desc" ]],
//"dom": 'Plfrtip',
"dom": '<"wrapper"flipt>', //total on top of datatable jquery
//"dom": 'lrtip',
//"dom": '<lf<t>ip>',
//"dom": '<"top"i>rt<"bottom"flp><"clear">',
searchPanes: {
            viewTotal: true
        },
        "orderCellsTop": true,
        "fixedHeader": true,
});

});

Example 2

$(document).ready(function() {
    // Setup - add a text input to each footer cell
    $('#example tfoot th').each( function () {
        var title = $(this).text();
        if(title == 'Status'){
        $(this).html( '<input type="text" size="5px" placeholder="'+title+'" />' );
        }
    });
 
    // DataTable
    var table = $('#example').DataTable({
        initComplete: function () {
            // Apply the search
            this.api().columns().every( function () {
                var that = this;
 
                $( 'input', this.footer() ).on( 'keyup change clear', function () {
                    if ( that.search() !== this.value ) {
                        that
                            .search( this.value )
                            .draw();
                    }
                } );
            } );
        },
        "columnDefs": [
        { "orderable": false, "targets": [1] },
        { 'searchable'  : false, 'targets' : [10] 
    },
        
    ],
    //"order": [[ 5, "asc" ]]
    });
 
} );

AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use ‘LogLevel debug’ to get a backtrace.

My htaccess file configuration

 
<IfModule mod_deflate.c>
  # Compress HTML, CSS, JavaScript, Text, XML and fonts
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/xml

  # Remove browser bugs (only needed for really old browsers)
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  Header append Vary User-Agent
</IfModule>

<IfModule mod_expires.c>
  ExpiresActive On

  # Images
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/gif "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
  ExpiresByType image/webp "access plus 1 year"
  ExpiresByType image/svg+xml "access plus 1 year"
  ExpiresByType image/x-icon "access plus 1 year"

  # Video
  ExpiresByType video/mp4 "access plus 1 year"
  ExpiresByType video/mpeg "access plus 1 year"

  # CSS, JavaScript
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType text/javascript "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"

  # Others
  ExpiresByType application/pdf "access plus 1 month"
  ExpiresByType application/x-shockwave-flash "access plus 1 month"
</IfModule>


<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule ^satta http://satta-king.soatechnology.net/
   # Force SSL
  #RewriteCond %{HTTPS} !=on
  #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
   # Remove public folder form URL
 #  RewriteRule ^(.*)$ exxamm/exxamm/public/$1 [L]
</IfModule>
#Options +SymLinksIfOwnerMatch 
#Options +FollowSymLinks

ErrorDocument 400 http://www.soatechnology.net/
ErrorDocument 401 /
ErrorDocument 403 http://www.soatechnology.net/
ErrorDocument 404 http://www.soatechnology.net/
ErrorDocument 301 http://www.soatechnology.net/
ErrorDocument 503 http://delhijurix.com/

<IfModule mod_rewrite.c>
  # RewriteEngine On
 #RewriteCond %{HTTPS} =on
 #RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R,L]

#RewriteEngine On
#RewriteBase /

#RewriteCond %{HTTPS} on
#RewriteRule ^ http://soatechnology.net/$1 [R=301,L]

   
   
</IfModule>

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
</IfModule>

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{ENV:REDIRECT_STATUS} ^$

RewriteCond %{HTTPS} !on           
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
<IfModule mod_rewrite.c>
RedirectMatch   "^/wp-login/?" /login
</IfModule>

<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>

# BEGIN FRedirect_ErrorDocument
# The directives (lines) between `BEGIN FRedirect_ErrorDocument` and `END FRedirect_ErrorDocument` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
#ErrorDocument 404 /index.php?error=404
# END FRedirect_ErrorDocument

Change value to only mod_rewrite section

<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase /
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.+)$ /index.php/$1 [L,QSA]
</IfModule>

AH00126: Invalid URI in request GET

There’s two issues here that are likely contributing to your troubles. First, you can’t check for file existence so easily in a server context (as you are with httpd.conf), because the request hasn’t been mapped to the file system yet.

If your requests for static resources happen to correspond directly to your file system structure beyond your DOCUMENT_ROOT, you can solve this by appending the value of DOCUMENT_ROOT before the incoming REQUEST_URI, as follows:

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d

If the path to your static resources is transformed somewhere down the line, the mod_rewrite documentation suggests using the following, which will issue a subrequest to perform a lookahead based on the request URI:

RewriteCond %{LA-U:REQUEST_FILENAME} !-f
RewriteCond %{LA-U:REQUEST_FILENAME} !-d

This approach is more expensive though, so try to use the first one where at all possible.

Secondly, the URI that you pass back into the request is actually invalid, because it needs the leading slash. Correcting that and combining it with the new conditions above gives you this modified rule set:

RewriteEngine On

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^.*$ /index.php?page=$0 [PT,QSA,L]

Note that the value of page here will always have a leading slash, so you might actually want to use this rule instead, depending on your handling logic in index.php:

RewriteRule ^/(.*)$ /index.php?page=$1 [PT,QSA,L]