How to distribute compiled extensions? - ampps

I have just started to experiment with Zephir over the weekend, and had managed to compile and run a hello world extension on the mac terminal. I have AMPPS installed, and am trying to install this extension on AMPPS. Not sure if my steps are correct, but if I copied the .so file over, I get this error from AMPPS:
Warning: PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-7.1/lib/extensions/ext/utils.so' - dlopen(/Applications/AMPPS/php-7.1/lib/extensions/ext/utils.so, 9): no suitable image found. Did find: /Applications/AMPPS/php-7.1/lib/extensions/ext/utils.so: mach-o, but wrong architecture /Applications/AMPPS/php-7.1/lib/extensions/ext/utils.so: stat() failed with errno=3 in Unknown on line 07.1.2
What is the correct way to install the compiled extensions on hosted servers in future?

The ERROR was obvious : Unable to load dynamic library '/Applications/AMPPS/php-7.1/lib/extensions/ext/utils.so' . That may mean your .so lib was not found. Maybe you past your extension lib file into an incorrect path.
So you can try to type php -i | grep extension in your terminal.
And it will output your extension path like extension_dir => /usr/local/lib/php/extensions/no-debug-non-zts-20151012 => /usr/local/lib/php/extensions/no-debug-non-zts-20151012.
Check your extension exist or not in this direction.
BTW you can using command php -m to check how many extensions you have installed .

Related

Setting DOTNET_ROOT to directory of libhostfxr.so is insufficient

If want to run dotnet-trace on Linux, against an application that ships with its own .NET Core runtime. When I run it, however, I get:
A fatal error occurred. The required library libhostfxr.so could not be found.
If this is a self-contained application, that library should exist in [/home/user/.net/dotnet-trace/RMBGJOBRwpkX5Kvpq_FShF5s1UmJMO8=/].
If this is a framework-dependent application, install the runtime in the global location [/usr/share/dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [/etc/dotnet/install_location].
I located the libhostfxr.so library at /home/user/app/libhostfxr.so, then executed DOTNET_ROOT=/home/user/app/ dotnet-trace, but got the same error.
How do I go from the path of this library to the correct setting for DOTNET_ROOT?
According to strace, it is looking for the file /home/user/app/host/fxr which does not exist.
I ended up installing the .NET version that matched the application I was trying to debug using the install script. (I found this by using strings libhostfxr.so; perhaps there's a better way.)
A little confusingly, the runtime version 3.1.28 is not the same as the corresponding SDK version 3.1.422, which I installed with:
$ wget -O - https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version 3.1.422
It can also be downloaded from versionsof.net which is not an official site, but it links to the files hosted by Microsoft.
This process installed /home/user/.dotnet/host/fxr/3.1.28/libhostfxr.so and I could then run DOTNET_ROOT=/home/user/.dotnet/ dotnet-trace.

The code executable cannot continue: libgcc_s_seh-1.dll was not found

I have a problem that I cannot solve, When I run the executable of my program it gives me the following error:
The code executable cannot continue because libgcc_s_seh-1.dll was not found. To fix the problem, try reinstalling the program
I tried to manually copy and paste the file (libgcc_s_seh-1.dll) into the folder where I keep the executable but I get the following error:
The application could not be started correctly (0xc000007b)
Additional information:
I use windows 10 64 bit
I Use mingw81_64
I use version 6.1.2 of Qt
What can I solve the problem?
I guess you double-clicked in exe file that provides after building in release mode :
For Deploy and create Exe output with QT in windows you should follow this way:
put your compiler path in your system path. now you use mingw81_64 you should set it. something like Qt/tools/mingw81_64/bin
copy exe file that provides after building in release mode in one folder and run mingw81_64 cmd (it has separate cmd)
and cd to that folder path
windeployqt app.exe
This command will get all dll needs for your app and your exe will work .
if you use qml
windeployqt --qmldir (the path of its directory ) app.exe
and also see these youtube videos for more info:
https://www.youtube.com/watch?v=LdSTgR0xJco
https://www.youtube.com/watch?v=hCXAgB6y8eA
For specific error of libgcc_s_seh-1.dll was not found, please try to copy libgcc_s_seh-1.dll, libstdc++-6.dll, libwinpthread-1.dll into your compiler path like Qt/tools/mingw81_64/bin.
You should copy libgcc_s_seh-1.dll, libstdc++-6.dll, libwinpthread-1.dll into your exefile path after executing windeployqt.exe with all files are in correct version.

Error when trying to package native image with javapackager in java 9-ea?

I'm trying out java 9-ea (jdk-9+180) and the new javapackager to create a native image from a simple module but I get a nullpointer exception. Anyone know if I'm just too early or if I'm not using the right command switches in order to get it to work? The jlink command works fine but the javapackager does not. I'm using the latest jdk-9+180 at the time of writing. I have tried both with the -native exe and -native image switches but the same type of error occurs. I have also tried this on my Mac creating a native dmg with the -native dmg switch, but the same error occurs on that platform. I'm really after using the javapackager here to be able to bundle the build in exe/dmg.
Edit 1:
I have filed a bug report regarding this issue and it can now be visible at the following url: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8186661
My module-info.java:
module my.module {
requires javafx.graphics;
requires javafx.fxml;
exports sample;
}
First I'm creating a jar with javapackager which works fine:
C:\Java9Test\target>javapackager -createjar -appclass sample.Main -srcdir classes -outdir . -outfile myjar -v
I have verified the resulting jar structure looks okay with the correct compiled module-info.class and the other two classes in it.
The following jlink command works and produces a runnable reduced runtime image:
C:\Java9Test\target>jlink --output release\MyTestApp --compress=2 --module-path "myjar.jar;C:\Program Files\Java\jdk-9\jmods" --add-modules my.module
However, when trying the following command in order to create the native image using javapackager fails:
C:\Java9Test\target>javapackager -deploy -v -outdir packages -name MyTestApp -native image --module-path "myjar.jar;C:\Program Files\Java\jdk-9\jmods" --add-modules my.module --module my.module/sample.Main
outputs:
Running [C:\Program Files\Java\jdk-9\bin\java.exe, -version] Creating app bundle: MyTestApp in C:\Java9Test\target\packages Exception: java.lang.NullPointerException Exception in thread "main" com.sun.javafx.tools.packager.PackagerException: Error: Bundler "Windows Application Image" (windows.app) failed to produce a bundle. at jdk.packager/com.sun.javafx.tools.packager.PackagerLib.generateNativeBundles(PackagerLib.java:374) at jdk.packager/com.sun.javafx.tools.packager.PackagerLib.generateDeploymentPackages(PackagerLib.java:348) at jdk.packager/com.sun.javafx.tools.packager.Main.main(Main.java:496)
Edit 2:
Output from -native exe flag (on Windows)
Running [C:\Program Files\Java\jdk-9\bin\java.exe, -version]
Running [C:\Program Files (x86)\Inno Setup 5\iscc.exe, /?]
Detected [C:\Program Files (x86)\Inno Setup 5\iscc.exe] version [5]
At least one type of shortcut is required. Enabling menu shortcut.
Exception: java.lang.NullPointerException
Config files are saved to C:\Users\Username\AppData\Local\Temp\fxbundler17330843784617821035\windows. Use them to customize package.
Exception in thread "main" com.sun.javafx.tools.packager.PackagerException: Error: Bundler "EXE Installer" (exe) failed to produce a bundle.
at jdk.packager/com.sun.javafx.tools.packager.PackagerLib.generateNativeBundles(PackagerLib.java:374)
at jdk.packager/com.sun.javafx.tools.packager.PackagerLib.generateDeploymentPackages(PackagerLib.java:348)
at jdk.packager/com.sun.javafx.tools.packager.Main.main(Main.java:496)
Edit 3:
Output from -native dmg flag (on MacOSX)
Building DMG package for MyTestApp
Exception: java.lang.NullPointerException
Config files are saved to /var/folders/qs/nk3vxsx90q9_pbjs0ypg74r40000gn/T/fxbundler3765252041328710759/macosx. Use them to customize package.
Exception in thread "main" com.sun.javafx.tools.packager.PackagerException: Error: Bundler "DMG Installer" (dmg) failed to produce a bundle.
at jdk.packager/com.sun.javafx.tools.packager.PackagerLib.generateNativeBundles(PackagerLib.java:374)
at jdk.packager/com.sun.javafx.tools.packager.PackagerLib.generateDeploymentPackages(PackagerLib.java:348)
at jdk.packager/com.sun.javafx.tools.packager.Main.main(Main.java:496)
Output from -native deb flag (on Linux Mint)
Running [dpkg-deb, --version]
Debian packages should specify a license. The absence of a license will cause some linux distributions to complain about the quality of the application.
Exception: java.lang.NullPointerException
Config files are saved to /tmp/fxbundler2941553392593775128/linux. Use them to customize package.
Exception in thread "main" com.sun.javafx.tools.packager.PackagerException: Error: Bundler "DEB Installer" (deb) failed to produce a bundle.
at jdk.packager/com.sun.javafx.tools.packager.PackagerLib.generateNativeBundles(PackagerLib.java:374)
at jdk.packager/com.sun.javafx.tools.packager.PackagerLib.generateDeploymentPackages(PackagerLib.java:348)
at jdk.packager/com.sun.javafx.tools.packager.Main.main(Main.java:496)
Output from -native rpm flag (on Linux Mint)
Running [rpmbuild, --version]
At least one type of shortcut is required. Enabling menu shortcut.
Exception: java.lang.NullPointerException
Config files are saved to /tmp/fxbundler2278571164448075269/linux. Use them to customize package.
Exception in thread "main" com.sun.javafx.tools.packager.PackagerException: Error: Bundler "RPM Bundle" (rpm) failed to produce a bundle.
at jdk.packager/com.sun.javafx.tools.packager.PackagerLib.generateNativeBundles(PackagerLib.java:374)
at jdk.packager/com.sun.javafx.tools.packager.PackagerLib.generateDeploymentPackages(PackagerLib.java:348)
at jdk.packager/com.sun.javafx.tools.packager.Main.main(Main.java:496)
Answering my own question here (after having received a reply on the bug-report):
It turns out that the module-path must contain only directory names, not file names, hence you can not specify the jar in the path as you can with the jlink command. The javapackager works with the module-path if set to the compiled module-classes like below, also you don't need to put in the module-path to the jmods directory because it is picked up automatically.
C:\Java9Test\target>javapackager -deploy -v -outdir packages -name MyTestApp -native image --module-path C:\Java9Test\target\classes --module my.module/sample.Main
However, the resulting build's executable MyTestApp.exe did not work for me, nothing happened when invoked (double-clicked). Also the build is quite bulky and it seems you can not use the --compress=2 and --strip-debug flags yet as you can with jlink. However, I discovered that you can actually replace the content of the runtime folder produced with the javapackager with the output from the jlink command giving the build a much smaller footprint and the MyTestApp.exe works when invoked! I could also delete the java.exe and javaw.exe from the replaced runtime\bin folder as well as the msvcp120.dll and msvcr120.dll from the main MyTestApp-folder since those dll:s are already in the MyTestApp\runtime\bin folder.
MyTestApp-folder structure:
.

Install Fixtures in Sylius - Symfony2

After having successfully installed and updated all vendors in my project folder for Sylius i tried running this code :
app/console sylius:install --fixtures
I get this error :
PHP Fatal error: Class 'ResourceBundle' not found in C:\wamp\www\sylius\vendor\
symfony\symfony\src\Symfony\Component\Locale\Locale.php on line 51
Then i tried all possible solutions given here
Installed intl extension in php (working successfully).Then ran this command
php build-data.php 'your ICU version'
On running the above command i get this:
'which' is not recognized as an internal or external command,
operable program or batch file.
The command "svn" is not installed
I want to know if there is another workaround to this issue.
Please help and thanks in advance.
P.S. - No SVN runs on my system. And i'm using icu*46.dll
Anyone came across this??
This error relates to be PHP intl-extension. Make sure it is enabled and you have the LATEST version.
quick test:
<?php
var_dump(extension_loaded('intl'));
Make sure your PHP folder is correctly registered in your %PATH% environment variable.
Control Panel - System - Advanced - ...
Without that, the ICU dlls are not loaded by PHP as Apache module - no error message is displayed, but the extension is not enabled.
Check aswell from phpinfo() ! not with ...
php -m
... or ( windows = findstr, linux/cygwin = grep )
php -i | findstr intl
check that the extension is enabled in your php.ini ( dont know WAMP's extenion path so adjust it please )
extension=php_intl.dll
As i can see you are on Windows and using WAMP you will have to get a precompiled version of the extension.
The packages on http://windows.php.net/download/ all contain the php_intl.dll in the ext folder.
Make sure that the ICU is compiled with the same version of MSVC that PHP is.
You run into problems if the ICU was compiled with VC10 and PHP was with VC9.
Although php -m and php -i detect the INTL it wouldn't show up in phpinfo().

Link error while building with command scons compiler=msvc

I am trying to build a program using the command scons compiler = msvc. During this action a link error appears: LNK1181: cannot open input file 'QtCore4.lib'. I have installed Qt for Windows from http://qt.nokia.com/downloads (the free version) and tried to find the requested lib file, but only found the same dll file.
Any advice on how to proceed would be most appreciated.
It seems I have built Ot using debug option. Without it creates all the necessary libraries.

Resources