Archives

Setup Ioncube in PHP 7.4 in RunCloud/Nginx

I recently need to install Ioncube in a droplet using PHP 7.4 (yup. it’s almost 2025, and it still using PHP 7.x)

I found this docs from runcloud https://runcloud.io/blog/ioncube-loader
But it’s for general/various server. Here’s the command I use to successfully install it for PHP 7.4

Download and extract:

cd /tmp/
wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar -zxvf ioncube_loaders_lin_x86-64.tar.gz

Copy and update PHP ini:

cp ioncube/ioncube_loader_lin_7.4.so /RunCloud/Packages/php74rc/lib/php/extensions/no-debug-non-zts-20190902
echo "zend_extension=ioncube_loader_lin_7.4.so" > /etc/php74rc/conf.d/ioncube.ini
systemctl restart php74rc-fpm

Confirm:

/RunCloud/Packages/php74rc/bin/php -m | grep -i ioncube

And all working correctly (at least in my test).
However, if you encounter issue. Here’s how to solve it:

How to solve:

  • Ioncube provided a loader wizard: https://www.ioncube.com/loaders.php
  • You can simply download the single PHP file.
  • Upload it in your server.
  • Run it in your browser
  • And it will show how to install it properly or if there’s a miss-configuration.
  • Very neat!

SECURITY NOTE: always delete this file after use.

The song that saved the world

~ Gutalala.. Sudalala..

日が暮れて どこからか
hi ga kurete doko kara ka
The sun goes down, and somewhere

カレーの匂いがしてる
karee (curry) no nioi ga shiteru
I can smell curry cookin’

どれだけ歩いたら 家にたどりつけるかな
dore dake aruitara ie ni tadori tsukeru kana
How long will we have to walk before we get home?

僕のお気に入りの 肉屋のコロッケは
boku no oki ni iri no nikuya no korokke (croquette) wa
Will the croquettes from my favorite shop

いつもどおりの味で 待っててくれるかな
itsumo doori no aji de mattete kureru kana
Still taste the same? And waiting for me?

地球の上に夜が来る
chikyuu no ue ni yoru ga kuru
Night comes down upon the earth

僕は今 家路を急いでる
boku wa ima ieji o isoideru
And now, I’m hurryin’ home

来年のことを言うと 鬼が笑うっていうなら
rainen no koto o iu to oni ga warautte iu nara
They say the demons will be laughing next year

笑いたいだけ 笑わせとけばいい
waraitai dake warawase tokeba ii
And I say, let ’em laugh all they like

僕は言い続けるよ 5年先10年先のことを
boku wa ii tsuzukeru yo gonen saki juunen saki no koto o
I’ll keep talkin’ about 5 or 10 years in the future

50年後も キミとこうしているだろうと
gojuunen go mo kimi to koushite iru darou to
And 50 years later, if I’m still with you

地球の上に夜が来る
chikyuu no ue ni yoru ga kuru
Night comes down upon the earth

僕は今 家路を急ぐ
boku wa ima ieji o isogu
And now, I’m hurryin’ home

雨が降っても 嵐が来ても
ame ga futte mo arashi ga kite mo
Rain may fall, and storms may come

やりが降ろうとも みんな家に帰ろう
yari ga furou to mo minna ie ni kaerou
Spears may fall, so let’s all go home

邪魔させない 誰にも止める権利はない
jama sasenai dare ni mo tomeru kenri wa nai
They can’t stop us, nobody has the right to stop us

地球の上に夜が来る
chikyuu no ue ni yoru ga kuru
Night comes down upon the earth

僕は今 家路を急ぐ
boku wa ima ieji o isogu
And now, I’m hurryin’ home

世界中に夜が来る
sekaijuu ni yoru ga kuru
Night comes down upon the earth

世界中が家路を急ぐ
sekaijuu ga ieji o isogu
And now, I’m hurryin’ home

そんな毎日が キミのまわりで
sonna mainichi ga kimi no mawari de
And I pray that these days will continues

ずっと ずっと 続きますように…
zutto zutto tsuzukimasu you ni…
I hope it continues forever…

How To Disable Typography Option in WordPress 5.9

It’s very simple to disable it, you can simply drop this in your theme functions.php or add it in your plugin.

add_action(
	'after_setup_theme',
	function() {
		add_theme_support( 'editor-font-sizes', [] );

		add_filter(
			'block_editor_settings_all',
			function( $editor_settings, $context ) {
				$editor_settings['__experimentalFeatures']['typography']['fontWeight'] = false;
				$editor_settings['__experimentalFeatures']['typography']['letterSpacing'] = false;
				$editor_settings['__experimentalFeatures']['typography']['textTransform'] = false;
				$editor_settings['__experimentalFeatures']['typography']['fontStyle'] = false;
				return $editor_settings;
			},
			10,
			2
		);
	}
);

How to Disable Drop Cap Settings?

You can simply add this code:

$editor_settings['__experimentalFeatures']['typography']['dropCap'] = false;

Custom Field & Meta Box in Gutenberg Editor

How to do this in the “new” way?

From this:

To this:

Creating a custom field using a custom meta box is simple and very straightforward.

Basically we create a meta box using meta box API and add it in post meta data using save_post hook.

Here’s the basic code:

// Add field:
add_action( 'add_meta_boxes', function() {
	add_meta_box(
		'my_meta_box',
		'My Meta Box',
		function( $post ) {
			wp_nonce_field( __FILE__, '_my_data_nonce' );
			?>
			<p><input type="text" class="large-text" name="my_data" value="<?php echo esc_attr( get_post_meta( $post->ID, '_my_data', true ) ); ?>"></p>
			<?php
		},
		'post',
		'side'
	);
} );
// Save field.
add_action( 'save_post', function( $post_id ) {
	if ( isset( $_POST['my_data'], $_POST['_my_data_nonce'] ) && wp_verify_nonce( $_POST['_my_data_nonce'], __FILE__ ) ) {
		update_post_meta( $post_id, '_my_data', sanitize_text_field( $_POST['my_data'] ) );
	}
} );

But how to do this in the new way?

Read More Custom Field & Meta Box in Gutenberg Editor

How to Create Valid SSL in localhost for XAMPP

Chrome browser updates has become a burden for local development. Not only they decided to disable .dev domain for local development, they also really have specific configuration in SSL Cert to show the site as secure.

In this step by step tutorial I will try to explain  the walk-through to create SSL cert locally to be used in XAMPP in Windows.

Read More How to Create Valid SSL in localhost for XAMPP