Tuesday, September 20, 2022

Fix "xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance"

 1. 

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer


2.

xcodebuild -runFirstLaunch

Saturday, August 27, 2022

Fix "Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP. AH00013: Pre-configuration failed"

The below steps apply for PHP8:
1. Go to /etc/httpd/conf.modules.d

2. Edit 00-mpm.conf

3. Uncomment following line:
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

4. Comment both the following:
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
#LoadModule mpm_event_module modules/mod_mpm_event.so


5. Start Apache
service httpd start

Friday, August 26, 2022

Fix "XMLReader Support Missing" WordPress error - AWS Linux 2 instance



When trying to import a site plugin, you could get the following error:

You're close to importing the template. To complete the process, please clear the following conditions.

    XMLReader Support Missing


To fix it, please follow the next steps:

1. Make sure the installed php version is 8.0:
php -v
PHP 8.0.20 (cli) (built: Jun 23 2022 20:34:07) ( NTS )


If not, follow the steps described here to upgrade to PHP 8.0:
https://www.cyberciti.biz/faq/install-php-7-2-7-3-7-4-0r-8-0-on-amazon-linux-2/

2. Install xml support:
yum install php-xml

3. Enable all xml modules:
php -i --enable-xml
php -i --enable-xmlreader
php -i --enable-xmlwriter

4. Check modules are installed:
php -m

5. Restart php
service php-fpm restart

6. Restart httpd
service httpd restart

All set.

Wednesday, August 24, 2022

View WordPress memory consumption

 1. Install and Activate Server IP & Memory Usage Display


 

2. This will add a banner at the footer at WordPress App:


 

 

 3. Optional - If needed to increase PHP or WP Memory limit.

 PHP - Edit php.ini file and change the following line:

memory_limit = 256M

WordPress - Edit wp-config.php and add the following line:


define( 'WP_MEMORY_LIMIT', '200M' );
/* That's all, stop editing! Happy publishing. */

Monday, October 18, 2021

Hide shadow or margin under react native header

 In old <5 react native you could just hide using shadowOpacity (iOS) or elevation (Android). This is not anymore valid in React >= 6.

For this you need to use headerShadowVisible for both iOS and Android.


An example is below:

<Stack.Navigator screenOptions={{
        headerStyle: {
            backgroundColor: Colors.light.tint,
            
        },
        headerShadowVisible: false,
        headerTintColor: Colors.light.background,
        headerTitleAlign: "left",
        headerTitleStyle: {
            fontWeight: 'bold',
        }
    }}>

Sunday, October 17, 2021

tabBarOptions - deprecated in React Native 6 - No overload matches this call.

Fix by using screenOptions as described below:

<MainTab.Navigator
      initialRouteName="TabOne"
      screenOptions={{
        tabBarActiveTintColor: Colors[colorScheme].background,
        tabBarStyle:{
          backgroundColor: Colors[colorScheme].tint,
        }
      }}>

Fix Error: EMFILE: too many open files

Exact error is this:

 Error: EMFILE: too many open files, watch
    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:203:21)

 

To fix it, please just install watchman on your Linux/OS X system:
 

brew install watchman