{"id":19923301,"url":"https://github.com/firebirdsql/php-firebird","last_synced_at":"2025-04-06T02:07:25.139Z","repository":{"id":36456963,"uuid":"218351129","full_name":"FirebirdSQL/php-firebird","owner":"FirebirdSQL","description":"Firebird PHP driver","archived":false,"fork":false,"pushed_at":"2025-03-09T10:18:12.000Z","size":625,"stargazers_count":70,"open_issues_count":32,"forks_count":17,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-03-30T01:08:11.660Z","etag":null,"topics":["firebird","ibase","php"],"latest_commit_sha":null,"homepage":"https://firebirdsql.org/en/php-driver/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FirebirdSQL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-29T18:02:39.000Z","updated_at":"2025-03-12T05:25:19.000Z","dependencies_parsed_at":"2023-12-19T09:51:58.573Z","dependency_job_id":"5acfb9ea-e74b-4409-9c98-72c68a9b41e5","html_url":"https://github.com/FirebirdSQL/php-firebird","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FirebirdSQL%2Fphp-firebird","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FirebirdSQL%2Fphp-firebird/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FirebirdSQL%2Fphp-firebird/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FirebirdSQL%2Fphp-firebird/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FirebirdSQL","download_url":"https://codeload.github.com/FirebirdSQL/php-firebird/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423513,"owners_count":20936626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firebird","ibase","php"],"created_at":"2024-11-12T22:13:43.908Z","updated_at":"2025-04-06T02:07:25.122Z","avatar_url":"https://github.com/FirebirdSQL.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Firebird extension\n\n## Building the driver\n\n### Build the driver on Linux\nFirst of all, we have to meet some requirements. This means we need to install the `phpize` command. The `phpize` command is used to prepare the build environment for a PHP extension.\nInstall the `phpize` command. This is usually done by installing the `php7-devel` or `php8-devel` package using the system's package manager. Also install the fbclient library and developer packages.\n\nFor OpenSuse 15.1 and PHP 7 use\n```\n$ zypper in php7-devel libfbclient2 libfbclient-devel\n```\n\nThe command in Linux Mint 20 / Ubuntu is\n```\nsudo apt-get install php-dev firebird-dev firebird3.0 firebird3.0-common firebird3.0-server\n```\n\nNow make sure you provide the fbclient.so and the header files (ibase.h). These are needed to compile. You can specify the include path for the ibase.h file with CPPFLAGS as you can see in the following listing.\n```\n$ git clone https://github.com/FirebirdSQL/php-firebird.git\n$ cd php-firebird\n$ phpize\n$ CPPFLAGS=-I/usr/include/firebird ./configure\n$ make\n```\n\nNote: If you use different PHP versions in parallel don't forget to make the correct settings. Linux Mint 20 / Ubuntu uses this syntax:\n```\n$ git clone https://github.com/FirebirdSQL/php-firebird.git\n$ cd php-firebird\n$ phpize7.4\n$ CPPFLAGS=-I/usr/include/firebird ./configure --with-php-config=/usr/bin/php-config7.4\n$ make\n```\n\nIf the configure process passes you will get following message:\n```\n$ Build complete.\n$ Don't forget to run 'make test'.\n```\nYou can find the `interbase.so` file in directory `php-firebird/modules`. Copy the file to your php extension dir and restart your webserver.\n\n#### Clean up your working directory\nAfter you've created the binary data, many temporary files will be created in your working directory. These can be removed with the command `phpize --clean`. Then you have a tidy directory again.\n\n### Build the driver on Windows\nFirst of all, we have to meet some requirements. This means we need to install the Git for Windows and Visual Studio 2017 with following components:\nVisual C++ 2017 (vc15) or Visual C++ 2019 (vs16) must be installed prior SDK usage. Required components\n- C++ dev\n- Windows SDK\n- .NET dev\n\nAlso make sure you are using a 64-bit build host with Windows 7 or later.\nOf course we need some Firebird related stuff. The easiest way is to install the related Firebird version on your build host including the development files.\n\nTo start the build process open a command line. We assume that the build is done in the directory `c:\\php-sdk`. So make sure you have the permission to create that folder on Drive C:.\n```\ngit clone https://github.com/Microsoft/php-sdk-binary-tools.git c:\\php-sdk\ncd c:\\php-sdk\ngit checkout php-sdk-2.2.0\n```\nWith the above we downloaded the PHP SDK and entered our working directory. \n\nNext we will prepare our build environment.\nFor Win32 do:\n```\nphpsdk-vc15-x86.bat\n```\nUse following command for Win64:\n```\nphpsdk-vc15-x64.bat\n```\nIf you use VS 2019, replace vc15 by vs16.\n\nNow let's create the build structure, download the PHP sources and checkout the desired development branch:\n```\nphpsdk_buildtree phpmaster\ngit clone https://github.com/php/php-src.git \u0026\u0026 cd php-src \u0026\u0026 git checkout PHP-7.4.0\n```\n\nSince we have our PHP sources now, we're on to get the depending libraries.\n```\nphpsdk_deps --update --branch 7.4\n```\n\nIn the next step we will download our Firebird extension sources.\n```\nmkdir ..\\pecl\ngit clone https://github.com/FirebirdSQL/php-firebird.git ..\\pecl\\interbase\n```\n\nIf everything is ok, we can now compile our PHP extension. Please specify the the correct path to your Firebird installation.\n\n#### Build TS extension\nUsually you will build thread safe extensions.\nFor Win32 thread safe (TS) do:\n```\nbuildconf --force \u0026\u0026 configure --disable-all --enable-cli --with-interbase=\"shared,C:\\Program Files (x86)\\Firebird\\3_0\" \u0026\u0026 nmake\n```\nFor Win64thread safe (TS) do:\n```\nbuildconf --force \u0026\u0026 configure --disable-all --enable-cli --with-interbase=\"shared,C:\\Program Files\\Firebird\\3_0\\lib\" \u0026\u0026 nmake\n```\nAfter the compilation you can find your extension called `php_interbase.dll` e.g. in `C:\\php-sdk\\phpmaster\\vc15\\x64\\php-src\\x64\\Release_TS\\php_interbase.dll`\nReplace x64 with x86 for Win32.\n\n#### Build NTS extension\nFor Win32 non-thread safe (NTS) run:\n```\nbuildconf --force \u0026\u0026 configure --disable-zts --disable-all --enable-cli --with-interbase=\"shared,C:\\Program Files (x86)\\Firebird\\3_0\" \u0026\u0026 nmake\n```\nFor Win64 non-thread safe (NTS) run:\n```\nbuildconf --force \u0026\u0026 configure --disable-zts --disable-all --enable-cli --with-interbase=\"shared,C:\\Program Files\\Firebird\\3_0\\lib\" \u0026\u0026 nmake\n```\nAfter the compilation you can find your extension called `php_interbase.dll` e.g. in `C:\\php-sdk\\phpmaster\\vc15\\x86\\php-src\\Release`\nReplace x86 with x64 for Win64.\n\n#### Clean up your working directory\nAfter you've created the binary data, many temporary files will be created in your working directory. These can be removed with the command `nmake clean`. Then you have a tidy directory again.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebirdsql%2Fphp-firebird","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirebirdsql%2Fphp-firebird","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebirdsql%2Fphp-firebird/lists"}