Questions tagged [zephir]
Zephir - Ze(nd Engine) Ph(p) I(nt)r(mediate) - is a high level language that eases the creation and maintainability of C-extensions for PHP.
33
questions
0
votes
0
answers
11
views
Zephir during compile make errors
Environment: OS: Win 10, php 7.4.x.
I have installed Zephir(0.17.0), zephir_parser(1.6.0) - OK.
Command zephir init - OK, then i created tsheet.zep file with source code.
But when i am trying ...
0
votes
1
answer
172
views
Upgrading PHP 7.4 to PHP 8.0 for Zephir Parser (Unable to initialize module)
php -v yields the following output:
PHP 8.0.28 (cli) (built: Feb 14 2023 18:32:57) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.28, Copyright (c) Zend Technologies
with Zend OPcache v8.0....
0
votes
0
answers
199
views
Zephir installation on Windows OS
I'm trying to start with Zephir on Windows 10 OS, PHP Version 7.3.0.
I've to figure out the installation guide. I guess, I don't need GCC according to Download and Install GCC Compiler in C for ...
0
votes
0
answers
91
views
Zephir PHP extension built on Mac M1 doesn't work on the Ubuntu server
I have used the Zephir lang for building the PHP extension. I'm using the Mac M1 and build the extension inside the docker container using Ubuntu 21.10 image with the same PHP verison 8.0. But the ...
0
votes
2
answers
107
views
Zephir build throws "exhausted allowed memory size" on newly cloned Phalcon repo
General
software: MacOS
Phalcon: 5.0.x
PHP: 8.1
Zephir: 0.16.0
brew: [email protected]
Location: ~/Documents/cphalcon
Details
I have just cloned phalcon following the instructions here.
I have already ...
0
votes
0
answers
101
views
Zephir Returned values by functions can only be assigned to variant variables
So, i want to make an PHP extension by Zephir that can encrypt and encode a source code, but i have an error which is :
Error Message:
[ERROR] Returned values by functions can only be assigned to ...
0
votes
1
answer
74
views
What's the difference between var and let in Zephir
I read the Zephir's documentation (https://docs.zephir-lang.com/0.12/en/types) and I'm not sure I understand the difference between var and let in Zephir. My first thought was that maybe var only ...
0
votes
0
answers
43
views
Is it somehow possible to forbid external instantation of an extension class in Zephir?
I have not installed or tinkered with Zephir yet.
Because before I do, I'd like to know whether it is possible to define PHP classes inside a Zephir extension that can only be instantiated by the ...
0
votes
1
answer
365
views
How to distribute compiled extensions?
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 ...
2
votes
1
answer
403
views
error zephir_parser extension not loaded windows
I have followed all steps here to install zephir on windows 7 32bits
I run php with wampserver 2.5, I have downloaded PHP5.6.33 and added it to wampserver successfully
I have installed visual studio ...
0
votes
0
answers
140
views
Why I am getting this error in zephir php extension development?
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/myapp.so' - /usr/lib64/php/modules/myapp.so: undefined symbol: zend_error_noreturn in Unknown on line 0
My code (myapp....
2
votes
1
answer
4k
views
PHP unable to load dynamic extension (invalid ELF header) [PHP + Zephir]
got a little problem over here. I've compiled example Zephir plugin on my machine, which works fine on the workstation, but when I move it eg. to production server, I receive this weird php error:
...
1
vote
0
answers
194
views
Zephir curl dependency
How to properly introduce the curl extension as a dependency?
Simply trying to create an array that references constants from the curl extension like so
public function __construct()
{
let this-&...
1
vote
0
answers
94
views
How to call my extension method to detect written annotation?
Hi i'm tring to write an extension for php in zephir or php-cpp to call my customMethod from my extention when comment block like code below added to php file any suggestion note will be appreciate
&...
1
vote
1
answer
541
views
zephir_parser extension not loaded
I'm running on ubuntu 14.04 and I installed php5.6. I'm trying to do the Hello world with Zephir but when I compile my project with :
zephir build
I got this error :
zephir_parser extension not ...
8
votes
1
answer
4k
views
PHP Fatal error: Class 'jsonserializable' not found in Unknown on line 0
Ubuntu 16.04
PHP 7.0.4
Phalcon 2.1.x
Zephir
$~: php -v
PHP Fatal error: Class 'jsonserializable' not found in Unknown on line 0
When add phalcon.so in php.ini
1
vote
0
answers
144
views
Zephir extension class in Global space
Is it possible to create a Zephir extension that exposes classes in the PHP Global space?
Without any namespace definition, all class and function definitions are placed into the global space
Any ...
0
votes
1
answer
303
views
Error while compiling in Zephir
I'm trying a simple "Hello World" in Zephir. I created the project with zephir init utils.
The json contains the namespace:
"namespace":"utils",
"name":"utils"
I followed these steps
PHP 5.3....
0
votes
1
answer
67
views
Zephir throws error on line 1
I am trying to make simple php extension via zephir, but zephir does not want to work.
Here is my code:
namespace Const;
class Hello {
public static function world() {
echo "Hello World!...
0
votes
1
answer
342
views
Zephir on Windows and Linux (ubuntu) - errors
Afters hours and hours spend on trying to install zephir on my windows 8, i finally managed to build an single .zep file !
Now, i've copied the .dll from /ext/Release directory, into my xampp/php/ext ...
0
votes
1
answer
877
views
Zephir giving error on windows: Installation is not implemented for windows yet
When i build extension with Visual Studio Command Prompt (2010) it gives error:
Cannot load Xdebug - it was built with configuration
API220100525,TS,VC9, whereas running engine is API220100525,NTS,...
2
votes
1
answer
797
views
Using PDO in Zephir
As part of my experiments with Zephir I am currently trying to use PHP PDO to access a MySQL database. For starters I found that a relatively innocuous
$dbh = new PDO("mysql:host=localhost;...
0
votes
2
answers
8k
views
Loading extensions in php5-fpm
I am in the process of experimenting with Zephir on my Nginx/php5-fpm/ubuntu14.04 setup. I followed their tutorial and managed to compile my first Zephir PHP extension with little difficulty. ...
-1
votes
1
answer
479
views
Connect to mysql using Zaphir
How can I connect to my sql using Zephir, also I'm using php, I tried the link but failed.
this is how I use the code.
public function setConnection(connection) -> void
{
let this->...
8
votes
1
answer
3k
views
Is it possible with Zephir to include an external library?
I have some code in C which does some hardware access. This code is ready and well tested. Now I want to implement a web interface for controlling this hardware. So I came along PHP extension ...
0
votes
1
answer
147
views
Zephir Language Parse Exception
I am trying to compile the below code in zephir language and it gives me Parse error.
I am not sure what am I doing wrong.
public static function calculateDiscrepancy(tpImpr, liImpressions, defaults)...
3
votes
1
answer
2k
views
Need Help Understanding a Crude Benchmark: Regular PHP vs HHVM vs Zephir
I performed this test using a simple factorial function (borrowed the logic from http://avelino.xxx/2014/03/golang-c-and-python-the-benchmark-time)
Regular PHP Code
function fact($n){
if($n===0)...
1
vote
1
answer
845
views
run zephir build error on tutorial
I installed zephir OK (0.3.7a) and run the test, and got error as follows:
[root@vmlinux64 test]# zephir build PHP Warning: system() has been
disabled for security reasons in
/usr/local/lib64/...
0
votes
1
answer
572
views
Zephir Tutorial Error
I try to apply http://zephir-lang.com/tutorial.html .I run this code in my desktop(text_ext directory).
zephir init utils
cd utils
and zephir build results are:
baris@ubuntu:~/Desktop/test_ext/...
0
votes
0
answers
502
views
Zephir Error : Unable to load dynamic library '/usr/lib/php5/20121212/utils.so'
Today, i installed 'Zephir' on my ubuntu machine. After spending some hour(going through zephir docs) with Zephir I noticed 2 things.
- The 'config.json' file which suppose to be created inside of "...
4
votes
1
answer
1k
views
Multiple class files in a Zephir extension
I'm doing some experiments with Phalcon Zephir to see how well it can convert some of my libraries to PHP extensions.
I have two PHP classes, each already defined in its own file: the Zephir notes ...
3
votes
1
answer
882
views
run the zephir language on windows machines
Is it possible to use the zephir language on a windows system when the packages json-c and re2c are required.
Can I somehow install or build the packages in windows to then build and run zephir?
4
votes
2
answers
2k
views
How can I install Zephir on Ubuntu?
I would like to install Zephir on my Ubuntu machine.
The goal is to convert some of my existing code into a PHP extension, in order to get the benefits of faster execution.
Any pointers are more ...