How to copy intl.so to /usr/lib/php/extensions - macos

I wanted to try Moodle (LMS) on my computer. It requires intl extension.
I used sudo port install php71-intl and successfully installed php71-intl. But it also installed php71 and other dependencies on /opt/local/.
I am using Mac built-in php. Its directories are
/usr/lib/php/extensions/no-debug-non-zts-20160303
/usr/bin/php
I intended to copy the /opt/local/lib/php71/extensions/no-debug-non-zts-20160303/intl.so to /usr/lib/php/extensions/no-debug-non-zts-20160303. But terminal said Operation not permitted.
I tried sudo pecl install intl but failed with make error.
This method sudo port install php71-intl can install the intl.so successfully but in its own direcotry.
So how I can copy the intl.so? Thank you!

You have to disable SIP to do that. First, restart your Mac and before OS starts up, hold down Command-R and keep it held down until you see an Apple icon and a progress bar. Release. This boots you into Recovery. From the Utilities menu, select Terminal and at the prompt type exactly the following and then press Return: csrutil disable
Terminal should display a message that SIP was disabled. From the menu, select Restart. You can re-enable SIP by following the above steps, but using csrutil enable instead.

Find this file "environment.xml" and comment all lines that have "intl" and reload the page. Continue button appears and installation completes without any error. My instance started working like charm, I use it to test out and create courses with SCORM packages, no errors yet.
environment.xml file is located in "admin" folder of moodle directory

Related

XAMPP doesn't work after update to macOS Big Sur

Today I updated my mac to macOS Big Sur and I can't open XAMPP. When I click on app it doesn't give any response.
Do you know how solve this problem?
You can do a clean installation, but you will lose all your old files and databases. I suggest making a backup of this data.
Uninstall old versions of xampp.
Installation of Xampp by the brew
brew install --cask xampp
If you don't have the brew installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
HomeBrew
After Big Sur installation if XAMPP is not opening, get newest version of XAMPP (7.4.12) from their web site.
If you end up with error "Error starting “XAMPP” stack: cannot calculate MAC address: signal killed". After installing the latest version, do following:
Go to terminal ->
cd ~/.bitnami/stackman/helpers
Mv hyperkit hyperkit_backup
After that XAMPP opens and tells its the first time opening, but at least I found all the files etc as before Big Sur upgrade.
Install XAMPP 7.4.12, works perfectly in MacOS Big Sur
I had Xampp 7.4.9 and update Mac OS to Big Sur. Xampp didn't want to launch after that. I lost access to all my projects inside of /htdocs folder hidden somewhere in path structure of my virtual machine.
Kindly note I used version 7.4.9-VM (not 7.4.9-Installer) that is why all my files blocked inside of
/Users/'your_user_name'/.bitnami/stackman/machines/xampp/vm/machine.qcow2
Actually all files are important here:
/Users/'your_user_name'/.bitnami/stackman/machines/xampp
not only machine.qcow2
My solution is kind a mix of before mentioned solutions because they didn’t help in full.
First of all make a backup - copy old structure (with blocked files) to some directory - all this structure:
/Users/'your_user_name'/.bitnami/stackman/machines/xampp
(To see hidden files in MacOS use [Command]+[Shift]+[.])
You also can just rename
/Users/'your_user_name'/.bitnami/
to something like
/Users/'your_user_name'/.my_blocked_files_bitnami/
As programmers here advised to install 7.4.12-VM I installed this version. Very important to install "Virtual Machine" version (as you can see there are 2 installers for each version of Xampp)
Right after I launched 7.4.12-VM the new directory was created here:
/Users/'your_user_name'/.bitnami/
and Xampp will work properly but with no your old projects.
Do not do this step: As programmers here advised to change only one file
/Users/'your_user_name'/.bitnami/stackman/machines/xampp/vm/machine.qcow2
for me it was not enough - Xampp failed with an error:
ERROR: Error starting "XAMPP" stack: cannot start stack: ssh not accessible
My solution was put whole structure from folder xampp
/Users/'your_user_name'/.my_blocked_files_bitnami/stackman/machines/xampp
to here:
/Users/'your_user_name'/.bitnami/stackman/machines/xampp
You may before rename your current folder
/Users/'your_user_name'/.bitnami/stackman/machines/xampp
to something like
/Users/'your_user_name'/.bitnami/stackman/machines/new_xampp_without_my_projects
Then launch Xampp (Xampp should say something about incopatible versions but allows to continue), start all services, mount the disk. press "Expore" and you should see all your old projects.
Thank you.
You can solve this problem by updating xampp ver 7.2.34 .
https://www.apachefriends.org/download.html
Same thing happened to me but the version 7.4.12 seems to be working. I download it from the link I'll but below. I've been reading and the problem seems to be that Big Sur changes some paths that are set by default and so the apps won't launch. Same thing happened to Apache NetBeans.
XAMPP Download Link:
(https://sourceforge.net/projects/xampp/files/XAMPP%20Mac%20OS%20X/7.4.12/)
I had the same problem. This is how I solved it:
First, be sure that you back up your files in XAMPP VM. Your files are in
/Users/'your_user_name'/.bitnami/stackman/machines/xampp/vm/machine.qcow2
Then you can reinstall XAMPP again. I have installed 7.4.12 and it worked fine.
If you see stack error message, this is what you have to do:
Close XAMPP
Open a terminal and remove the stack folder with the following code:
rm -rf ~/.bitnami/stackman
Open XAMPP and check if a new stackman folder is created.
/Users/'your_user_name'/.bitnami/stackman/
If it does not, then start XAPP and stop again. When the stackman folder is created, override the file below with your backup file.
/Users/'your_user_name'/.bitnami/stackman/machines/xampp/vm/machine.qcow2
Close XAMPP again and restart again.
Voila! Here are your files...
I tried reinstalling XAMPP on MACos Big Sur, and it worked. However, my files are not recovered.
you can type this code in terminal
before this code you should close xampp
rm -rf ~/.bitnami/stackman
if you are getting error message saying:
Cannot calculate MAC Address: Using fd 10 for I/O notifications hv_vm_create HV_ERROR (unspecified error)
you need to download new hyperkit from bitnami and replace the current one
cd /tmp
curl -LJO "https://downloads.bitnami.com/files/hyperkit/hyperkit-testing-`20210430"`
mv /tmp/hyperkit-testing-20210430 ~/.bitnami/stackman/helpers/hyperkit
chmod +x ~/.bitnami/stackman/helpers/hyperkit
read tutorial here:
https://floyk.com/en/post/xampp-doesnt-work-after-update-to-macos-big-sur

Vue CLI Fails to install for Mac Mojave

I get the following error when setting up a new Vue project:
npm install -g #vue/cli
Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
I got around this error by changing permissions for two directories:
Set permissions to Everyone - Read / Write for
/usr/local/lib/node_modules
/usr/local/bin
Open Finder.
Press Command +Shift+G. A dialog box opens.
Enter the path and click Go
Right-click the directory and select Get Info
Click the lock icon to allow changes and enter your credentials
In the Sharing & Permissions section change everyone to Read & Write
Click the cog icon and select Apply to enclosed items from the drop down
Confirm the prompt
Reference Article:
https://forum.vuejs.org/t/vue-cli-installation-fails-on-macos-mojave-10-14/45712/5
As far as I know, its not just a Vue Cli issue but can happen for any node module.
Often this happens if you installed NPM as an administrator or using Sudo. You can usually get around it by doing something like sudo npm install xxx-package-xxx But that really just compounds the problem down the road when lots of things need elevated privileges.
In my case uninstalling and re-installing Node + NPM with a new package (not the ones included with MacOS) kind of helped but I eventually ended up nuking my OS and installing everything fresh.

MAC: Root User Not Getting Edit Permissions

I have authenticated root user as per this tutorial https://support.apple.com/en-us/HT204012
and edit menu shows Disable Root User option confirming it is enabled.
I am still getting EACCES errors and have to use sudo. Additionally, even with sudo, I am getting an EACCES error about mkdir in an npm package from a terminal script even though I have universal read and write permissions for the whole folder.
Does anybody know what's going on or how I can give myself universal use of the terminal without sudo?
To block malware, resent releases of macOS include System Integrity Protection, which makes the following directories unwritable except as part of an OS upgrade:
/System
/bin
/sbin
/usr (except /usr/local, that's writable)
"many" applications in /Applications
This feature can't be disabled while the system is booted up – it can only be disabled by rebooting off the "recovery" partition using the csrutil command:
Boot your mac holding Command + R before the Apple logo appears
Launch Terminal from the Utilities menu
Run csrutil status to check the status, and csrutil disable or csrutil enable to change it.
Reboot to exit the recovery partition
For more details:
https://developer.apple.com/library/mac/documentation/Security/Conceptual/System_Integrity_Protection_Guide/ConfiguringSystemIntegrityProtection/ConfiguringSystemIntegrityProtection.html

How Do I Build Hadoop From Source Without Errors

I have spent weeks trying to resolve different errors in building Hadoop. SO was helpful in pointing me towards the answer to an occasional problem, but after a lot of searching here on SO, I was never able to get the whole thing to build.
It’s been a couple of weeks since all this started so I have forgotten most of the explicit error messages, but the problems I had included
Protobuff versions being wrong
SSH connections not working
Mojofailure Exceptions during build
Incorrect Java versions being used
C++ sanity checks failing
a host of other crap that made no sense to me and I couldn't decipher root causes for
Today I finally got Hadoop to build from the git repo source and wanted to record the process for the SO community members that face similar problems.
For those of you trying to build Hadoop from source, here is how I got everything to compile from source.
Some notes on configuration:
I am installing Hadoop in a virtual environment, in my case VirtualBox.
The Host machine runs Windows 7 x64
The Guest VM runs CentOS 7 x64
I am aiming for the bare minimum installation
How to Build Hadoop From Source Without Errors
Preliminary Downloads:
You need to download the following before you begin.
Virtual Box (I used version 4.3.16 r95972 available here: old VB builds)
CentOS 7 minimal iso file from - http://www.centos.org/download/
WinSCP (version 5.7.4) - https://winscp.net/eng/download.php
This walk through consists of 4 Phases
Create a CentOS Appliance inside VirtualBox that can support
building Hadoop
Add SSH capabilities to the Appliance so that downloaded prerequisites can be scp’ed from the Host to the Guest VM
Install all the things (utilities and dependencies) needed to build Hadoop
Build Hadoop without errors
Phase 1 - Creating a CentOS Appliance for VirtualBox
Start by opening VirtualBox and clicking on the “New” button in the top left corner. This will open a new window asking for some information about the virtual machine appliance you want to create.
Name it “CentOS x64 – Hadoop Base”
Select Linux as the “Type” of operating system
Select RedHat (64 Bit) as the “Version.”
Click “Next”
Follow the remaining prompts in the VM creation wizard. The only things I changed from the defaults where on the “Memory size” passage (I used 4096 MB) and the “File location and size” passage (I used 128 GB). I would encourage you to do the same if your system can support it. Leave all other defaults alone
Click “Create” on the last passage of the VM creation wizard
Once created, the VM will show up on the left hand pane of the VirtualBox Window.
Double click on the VM you just created and wait for the dialog to come up asking you for the iso file you want to use.
When the dialog appears, click on the folder icon on the right and navigate to / select the “CentOS minimal iso” you downloaded during the Preliminary steps.
Once the iso is listed in the drop down box Click “Start”
When prompted, after the VM boots, select “Install CentOS 7” (this is not the default, you have to press the “up” arrow) and press “Enter”. When the setup program loads, the first thing it will ask you about is your keyboard layout. I leave the defaults in place and just click the “Continue” button in the lower right corner. This brings up the Installation Summary page on which you need to make changes to 2 areas: “Installation Destination” and “Network & Host Name”
Click “Installation Destination”
Double Click the virtual disk (make sure that the background is blue and the check mark is there)
Click “Done” to go back to the "Installation Summary" page.
Back on the Installation Summary page,
- Click “Network and Host Name”
- In this menu screen turn on Ethernet networking by clicking the toggle switch on the right.
- Click “Done” in the top left corner.
With both modifications complete you can click the “Begin Installation” button in the bottom right corner. As the iso installs to your system you should take the time to provide a root password by
Clicking on that option at the top left of the page
Filling out the form it brings up
Clicking “Done” (if you select a password considered weak, you have to double click “Done” to accept anyway).
I added a password, but I did not bother to add any non-root users.
Once everything is installed click on the “Reboot” button that appears in the bottom right of the screen.
Once the system reboots select CentOS 7 and allow it to boot. Check your credentials by logging in as root, and then close the CentOS VM by clicking on the red X button at the top right of the window and selecting “Power off the machine” when prompted.
This completes Phase 1
You should now be looking at just VirtualBox
Phase 2 - Adding SSH capabilities to the VM to support download transfers
Open the settings of your CentOS Appliance by first clicking the appliance
Next, click the “Settings” button on the top left of VirtualBox’s main menu. This will bring up a new window.
In the left hand pane of the new window, click on “Network” which will display a set of adapter tabs.
Now click on the Triangle to the left of the label “Advanced”.
This will reveal a series of options, but the one you need to click on is the button labeled “Port Forwarding”
This will bring up another window where you can set port forwarding rules.
Click the green plus sign in the top right corner. This will produce a row where you can enter in a port forwarding rule.
Add the following rule to the row
Name= ssh, Host port =2222, Guest port = 22
Click the “OK” button on the Port Forwarding window
Click the “OK” button on the Appliance Settings window.
With this rule in place you should now be able to ssh from your Windows Host to the CentOS Guest on port 2222 and avoid the following error:
ssh: connect to host localhost port 22: Connection refused
You should now be looking at just VirtualBox again.
Start the CentOS VM appliance and log in as root.
Once logged in, execute the following line from the command prompt.
yum –y install openssh-server openssh-client
This command will install a ssh server on the CentOS VM. After the install, confirm that the ssh server is running by typing the following command.
ps –aux | grep sshd
This command should return 2 processes showing sshd (the ssh daemon). One is the grep command itself. The other is your server running in the background.
Now we need to make sure that ssh did in fact generate the keys it will need to communicate with WinSCP. Issue the following command and make sure that all keys’ byte size values are non-zero.
ls -l /etc/ssh
If the sizes of the keys are 0 bytes, you need to remove them, restart the sshd daemon, and validate that the keys were regenerated when sshd restarted. To do all that, execute the following commands
rm –rf /etc/ssh/ssh*key*
systemctl restart sshd
ls -l /etc/ssh
This processes will help avoid unexpected “connection closed by 127.0.0.1” errors.
Now that we have an ssh daemon up and keys generated, we are going to test the connection. Start by opening WinSCP. And entering in the following values on the start menu that pops up.
Host name = localhost, Port number = 2222, User name = root, Password = , File Protocol = SCP.
Note that you need to set “File Protocol” last. If you don’t, it will try to outsmart you when you enter in a “Port number” that it isn’t expecting. When all the values are entered. Click the “Login” Button and accept / click Update or OK to any security warnings you get.
Once you have logged in, move a file between the Host and VM Guest to confirm everything is working.
Though I won’t focus on it here, you can also us Cygwin to connect to the VM, and it is useful for diagnosing connection problems. The command you need to enter to get verbose diagnostic output is
ssh –vvv –p 2222 root#localhost
This completes Phase 2
Phase 3 - Install Utilities and Dependencies Needed to Build Hadoop
Our CentOS distribution really is “barebones” and so we need to install everything required to build Hadoop. We will do this by downloading most things in Windows and then moving them over to the VM via WinSCP.
Before we start, we need to add a “downloads” directory to the home directory of the root user on the CentOS VM by issuing the following command at the CentOS command line.
mkdir ~/downloads/
We can now begin downloading Hadoop dependencies. We will download everything to Windows and then use WinSCP to move it over to the VM.
Start by downloading the Java 7 JDK from - http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
Ignore the “End of Public Updates” error message at the top of the page. Java 7 is what Apache recommends.
You want to download the jdk-7u79-linux-x64.rpm file
Once downloaded use WinSCP to navigate to the Downloads directory of the Host computer and the newly created “downloads” directory of the Guest VM (you may need to click the refresh icon on the VM side of the WinSCP pane to see the directory). Drag and drop the jdk file from the Host over to the VM Guest.
Now we just need to install the JDK on the CentOS VM. From the CentOS command line change your directory to the “downloads” folder we created under root’s home, once in the “downloads” directory use rpm to install java 7.
cd ~/downloads
rpm –ihv jdk-7u79-linux-x64.rpm
Once installation is complete, you can verify it by typing
java –version
Which will produce output stating that you have a Java Run Time Environment installed.
Next we are going to install a subset of the packages Hadoop needs to build successfully. The list is taken straight from the Apache website: https://wiki.apache.org/hadoop/HowToContribute and the command we need to enter on the command line to retrieve them is:
yum -y install lzo-devel zlib-devel gcc autoconf automake libtool openssl-devel fuse-devel
Next we are going to install Apache’s Maven. You can download it here:
https://archive.apache.org/dist/maven/binaries/
Apache’s website says you can use version 3+. I used version 3.2.2 so download this file to follow along:
apache-maven-3.2.2-bin.tar.gz
Once you have the file downloaded, use WinSCP to move it from your host computer to the Guest VM ‘s “downloads” folder just like you did with the JDK file. We then untar the file into the /usr/local/ directory, and create a symbolic link in the /usr/local/ directory that points to the maven folder with the following three commands.
tar xzf apache-maven-3.2.2-bin.tar.gz -C /usr/local
cd /usr/local
ln -s apache-maven-3.2.2 maven
We now need to add Maven’s bin directory to the $PATH variable. We do so by editing the .bashrc file in root’s home directory. Open the file for editing in vi by using the following command
vi ~/.bashrc
This will bring up the bash file in the vi editor ( if you need it, a tutorial on vi can be found here: http://www.unix-manuals.com/tutorials/vi/vi-in-10-1.html ) follow these instructions to correctly update the file.
Enter Edit mode by pressing the “a” key
Add the following lines to the file:
export M2_HOME=/usr/local/maven
export PATH=$M2_HOME/bin:$PATH
Press the “Esc” key to leave Edit mode
Type “:wq” – it will automatically show up at the vi command line (bottom left of the screen)
Press “Enter”
Now log out of CentOS. Log back into CentOS, and check to make sure that the new PATH variable is appropriately set using the following commands.
exit
<log back in as root>
mvn –version
you should see output indicating that maven is currently installed
Next we need to install C++ support for gcc. We do that with the following one line command
yum –y install gcc-c++.x86_64
Next we need to install git so that we can pull down the Hadoop source code.
yum –y install git
Once you have git. Go ahead and pull down the Hadoop source. There is still one more thing (ProtocolBuffer) we need before we can build the source code, but we need to see the BUILDING.txt file in the repo before we download ProtocolBuffer to make sure that we get the right version.
To get the Hadoop source we run the git clone command. Simply execute the following commands from the CentOS command line to download the Hadoop repo.
cd /usr/local
git clone git://git.apache.org/hadoop.git
The clone operation will place a “hadoop” directory in your /usr/local directory. When the operation has completed and you have the command prompt back, take a look at the BUILDING.txt file in your new hadoop directory using the following command:
less /usr/local/hadoop/BUILDING.txt
In the “Requirements” section of the file it states the version of ProtocolBuffer we need for Hadoop to build correctly. In this case it’s ProtocolBuffer 2.5.0. With this information in hand we go back to the command prompt by pressing “q” for quit.
Now we can finally, install the last of the things Hadoop needs: ProtocolBuffer. To get the right version of ProtocolBuffer, we visit the ProtocolBuffer release page:
https://github.com/google/protobuf/releases
and scroll down until we see the version needed for Hadoop to compile. For this walkthrough you want to download the following file.
protobuf-2.5.0.tar.gz
Once downloaded, use WinSCP and transfer it to the VM’s “downloads” folder like you did earlier for the other downloads. Once the file is sitting in the VM’s “downloads” folder, issue the following commands to install ProtocolBuffer on CentOS
cd ~/downloads
tar xzf protobuf-2.5.0.tar.gz -C /usr/local
cd /usr/local/protobuf-2.5.0
./configure
`make'
make install
Once this is done all the prerequisite utilities and dependencies needed for building Hadoop will be installed.
This completes Phase 3
Phase 4 - Build Hadoop Without Errors
Go to the Hadoop directory, and run Maven skipping the tests using the following commands:
cd /usr/local/hadoop
mvn clean install -DskipTests
The build should now occur without any problems and when everything is finished, you should see a screen like the one below.
This completes the walk through
I hope some of you find it helpful.
I know this was a question of how to build hadoop from source, but after running into a variety of errors throughout the build process, I found this extremely helpful. Someone has already built Hadoop on Windows and posted the binaries. I setup this version on my Windows machine and it is working great:
http://www.barik.net/archive/2015/01/19/172716/

Run window manager with chromium and go through proxy server on RPI

I am using Raspberry pi(s) for workstations in an office setup. I want the users to have access to the intranet and a couple of websites. I have a proxy set up with whitelist that works fine.
I want to boot the RPI and show only a web browser and connect through the proxy. I understand I need a window manager for this.
I have been experimenting with chromium (as it makes it very easy to insert the proxy address as an attribute when opening chromium via command line). The problem is, Chromium is a demanding browser and struggles with JQuery on the RPI.
I am looking for a browser I can run through a proxy, in a window manager from a start up script that won't be slow as hell!
Does this exist? Or am I going down the wrong path for this?
I don't know if this is really what you want but here is one way to boot directly into a web-browser:
1. Make sure you use a Raspberry with the latest version of raspbian installed and updated:
sudo apt-get update
sudo apt-get upgrade
2. If you don't want to use Midori, install the browser you want. I prefer chromium (Light version of Google Chrome) so that's what I will use here. To install chromium run the following command:
sudo apt-get install chromium
3. Configure raspi-config to start in GUI mode:
sudo raspi-config -> Enable boot to desktop/Scratch -> Desktop login as....
4. To start chromium on boot, comment all existing code in the file and add the following last:
sudo nano /etc/xdg/lxsession/LXDE/autostart
#xset s off
#xset -dpms
#xset s noblank
#chromium
On the last line you can also add switches like kiosk mode (--kiosk) after #chromium. Watch this link for more switches:
List of commandline switches
Hope this was any help! Good luck!

Resources