What do exactly mean by "PHP compilation options"? - compilation

I'm using PHP 7.2.8 on my laptop that runs on Windows 10 Home Single Language 64-bit Operating System
I've installed PHP 7.2.8 on my laptop using the latest copy of XAMPP installer.
I come across the following text from Description of phpinfo() function from PHP Manual
Outputs a large amount of information about the current state of PHP.
This includes information about PHP compilation options and
extensions,......
I did not get what do exactly mean by "PHP compilation options" from the above text taken from PHP Manual.
I checked the output of phpinfo(); by running it on my laptop.
I could only see the one line in output related to the compilation which is as below :
Compiler MSVC15 (Visual C++ 2017)
Is the above line mean the "PHP compilation options" mentioned in the PHP Manual or "PHP compilation options" is something else other than this?
If "PHP compilation options" means the same line I mentioned above then why there are not more than one compilation options present in the output of phpinfo(); ?

PHP is written in C. C is a compiled language, meaning you use a C compiler to create an executable binary from the source. When doing so, you can pass numerous options to influence things in the resulting binary.
See http://php.net/manual/en/configure.about.php for a partial list of possible compile options. Quoting
Most configure options are listed in their appropriate locations on the extension reference pages and not here. For a complete up-to-date list of configure options, run ./configure --help in your PHP source directory after running autoconf (see also the Installation chapter). You may also be interested in reading the ยป GNU configure documentation for information on additional configure options such as --prefix=PREFIX.
The phpinfo() page usually contains a line listing the Configure options:
For a more detailed explanation, check the chapter on bulding php in the PHP Internals book:
http://www.phpinternalsbook.com/build_system/building_php.html

Related

LuaJIT on Windows 10: unknown luaJIT command or jit.*

I've been trying to install LuaJIT on Windows 10 for some time following the official guide, and I actually get to install it. For example, if I execute luajit I get into the prompt. Also, luajit -v returns the version of luajit (2.0.4). And I can also execute code with luajit -e <lua code>. However, whenever I try to save bytecode with luajit -b, I get the following message:
luajit: unknown luaJIT command or jit.* modules not installed
I tried to make all sort of installations: using Cygwin, luajit-rocks, MinGW, ... However, no matter what I try, I always get the same result, and I have no clue of what to do.
Could you point me to some potential problems I might be overlooking?
I have on my system Lua 5.1 and Luarocks.
Some extra LuaJIT features are implemented as separate Lua modules (e.g. jit.bcsave for bytecode saving), and LuaJIT depends on package.path to find those modules. The suggested install location for those modules is in the default package.path, but if you override it via the LUA_PATH environment variable, you have to make sure to include that location there. One easy way to do that is to put two consecutive semicolons into LUA_PATH: Double semicolons are replaced by the compile-time default value of package.path.
You need place modules to "jit" folder near with juajit.exe. That folder include some system modules (bcsave too). package.path can dont work, becouse it hardlinked, how i understand. That folders distributed with source code.
Download lua from official sice: https://luajit.org/download.html
You can see "jit" folder inside archive:
LuaJIT-2.0.5.zip\LuaJIT-2.0.5\src\jit\

Installing YAML for PHP in IIS

I am trying to install the YAML 1.2 extension to PHP 5.6 under IIS 10 (Windows 10). I am using http://pecl.php.net/package/yaml/1.2.0/windows to download the files.
I have downloaded the PHP 5.6 non-thread-safe DLL (x86 to match my version of PHP), copied php_yaml.dll to my extension directory, copied yaml.dll to C:\Windows\System32 (which is reported as one of the paths in phpinfo()) and added extension=php_yaml.dll to my php.ini. I've verified with phpinfo() that the correct php.ini file is being loaded, and commenting out other extensions removes them from the output of phpinfo().
However, YAML doesn't appear in the output of phpinfo() and the functions are not loaded. Running php-cgi.exe -v from the command line gives a warning:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\PHP\php_5_06_14\ext\php_yaml.dll' - The specified module could not be found.
in Unknown on line 0
The file exists at the location specified and the permissions appear to be correct. What else can I do to get it working?
As far as I can tell, the use of PECL as package manager is being in dropping.
Having to install extensions in a server makes things more complicated and it depends on the environment, permissions, etc.
I'm sure someone could help you solve that (I haven't work on windows in years, so I can't)
But, instead I suggest you another solution. Maybe you can opt for it, maybe you have to stick with the extension, but, in case you can actually look for other option, I suggest you to use another library.
https://github.com/symfony/yaml
And, you could use Composer to install your libraries, I suggest you take a look at it.
Again, it may be for you or not, but I think this would be a lot easier.
I hope that helps.
I put the path to my extension directory in the path environment variable. That fixed the issue for me.

Where are hhvm command line flag definitions found?

When running phpunit 4.5 with hhvm inside docker sometimes it crashes the container. I'm not sure if I should alter the way I run hhvm on the command line or not. Are there any standards for running hhvm on the commandline?
So I'd like to get more familiar with hhvm's command line flags and definitions. Where can I find documentation on this?
I read on the https://codeascraft.com/2015/04/06/experimenting-with-hhvm-at-etsy/ that they used a tool called 'perf'. I don't seem to generate any perf.map files from the commandline. Browser requests have generated perf.map files though.
FYI
I've installed hhvm-nightly-dbg on ubuntu:14.10 to try to get more information when hhvm hangs on the command line.
My setup consists of the following
Mac osx Mavericks
Vagrant 1.7.2
VirtualBox 4.3.26
coreos-vagrant (running all containers with docker 1.5)
The containers are running
Redis:2.8.19
Mysql:5.1.73
hhvm-nightly-dbg
In our Ubuntu packages, configuration lives in /etc/hhvm/*.ini. Both files are loaded and combined when running in server mode.
Many INI options from PHP are available in HHVM with the same name. The HHVM-specific INI options are listed on the HHVM wiki; many are unfortunately missing documentation, though all of the important ones are there. There's a huge array of configurability here; you'll never need 99% of these.
/etc/init.d/hhvm controls the exact command-line options; you shouldn't need to modify this, set INI options instead.
Although you can pass any INI option to HHVM on the command line when not running in server mode, the mapping between command-line and INI syntax is weird and inconsistent for historical reasons. I'd strongly recommend just passing -c path/to/config.ini as a command line option instead, and just writing all your options in INI files. You can pass -c more than once; the files will be combined.

"Full REPL not supported. Falling back to simple shell" - error in Laravel While Trying To Use php artisan tinker

My Development Environment:
Windows 7 + WAMP
PHP Version: 5.4.16
While I try to use php artisan tinker - my console give me the following error:
REPL not supported. Falling back to simple shell
I search solution for this and found this :
Full REPL not supported
But this could not helped me much.I know Boris is By default supported by laravel 4.1.
And I might do some changes in php.ini according to this.
If the tinker command doesn't work for you, it is very likely the disable_functions setting in your php.ini contains the needed pcntl_() functions. Put a comment before this line in your php.ini and that should allow tinker to work.
Source :http://laravel-recipes.com/recipes/280
But when I Open my php.ini file the disable_functions contains nothing except this:
disable_functions =
; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. This directive is
; NOT affected by whether Safe Mode is turned On or Off.
; http://php.net/disable-classes
Is this My WAMP problem? Do I Missing Something !!!
Boris In Tinker
The php artisan tinker command now utilizes the Boris REPL if your system supports it. The readline >and pcntl PHP extensions must be installed to use this feature. If you do not have these extensions, >the shell from 4.0 will be used.
From the Laravel docs here:
http://laravel.com/docs/releases
So basically, they are telling you that php55-pcntl and readline needs to be installed.
Everytime I try to brew install php55-pcntl though, I get
configure: error: Cannot find openSSL's <evp.h>
Try running that and see what you get.
UPDATE: Use Laravel's Homestead environment
I completely gave up trying to run it on a XAMPP/WAMP/MAMP-style localhost.
If you go to the quickstart docs and scroll down to local development environment:
http://laravel.com/docs/quick#local-development-environment
It actually recommends you use Laravel's custom homestead environment:
http://laravel.com/docs/homestead
Read the docs for installing that and report back with results. It has been working perfectly for me.
One or more of readline posix and pcntl extensions are missing. You need to compile PHP with the appropiate configuration options to enabled it.
Here are the instructions:
readline http://www.php.net/manual/en/readline.installation.php
pcntl http://www.php.net/manual/en/pcntl.installation.php
posix http://www.php.net/manual/en/posix.installation.php
Note that posix functions are enabled by default.

cannot install or use ZeroMQ library

I am working on Debian Linux / Apache (a VPS at Dreamhost). I have tried to install ZeroMQ (version 3.2.3) as per these instructions. At the first glance, it looks like everything went well.
The sudo make install command proudly reports back that (among others)
Libraries have been installed in: /usr/local/lib
Indeed, here is the ls of /usr/local/lib:
libzmq.a libzmq.so libzmq.so.3.0.0 php python2.5 site_ruby
libzmq.la libzmq.so.3 ocaml pkgconfig python2.6
In order to use ZeroMQ I have added to my php.ini:
extension = /usr/local/lib/libzmq.so
But when I run PHP, I get:
PHP Startup: Invalid library (maybe not a PHP library) '/usr/local/lib/libzmq.so
What am I doing wrong?
update
As per djf's answer, I worked my way through the instructions for PHP bindings (building from Github). Those seem to work. But then, when I run PHP I get:
PHP Warning: PHP Startup:
zmq: Unable to initialize module Module compiled with module API=20060613
PHP compiled with module API=20100525
These options need to match in Unknown on line 0`
Now what?
update 2
Oh, wait a minute. I may know what that is. Dreamhost has PHP 5.2 on the command line. I need PHP 5.4, so I have been calling PHP like so /usr/local/php54/bin/php (this is apparently where the PHP 5.4 executable resides).
However, commands like configure and make use the ordinary, standard PHP. So I needed to upgrade CLI PHP to 5.4.
After that, everything worked. Thanks for the help, everyone!
Seems like you've only installed the C library, hence the error:
PHP Startup: Invalid library (maybe not a PHP library) '/usr/local/lib/libzmq.so
You also have to build the PHP bindings. Check these instructions on howto build them.
I do this for windows but i thinks linux is same.
Just go to http://pecl.php.net/package/zmq/1.1.2/windows and download package that fit with your php version.
Then extract it and coppy 'libzmq.dll' to 'xampp/php' folder, 'php_zmq.dll' to 'xampp/php/etc'.
At the end of 'php.ini' add following line:extension=php_zmq.dll
Don't forget restart your xampp!Good luck

Resources