php-src | popular general-purpose scripting language | Web Framework library

 by   php C Version: php-8.0.29 License: Non-SPDX

kandi X-RAY | php-src Summary

kandi X-RAY | php-src Summary

php-src is a C library typically used in Server, Web Framework applications. php-src has no bugs, it has no vulnerabilities and it has medium support. However php-src has a Non-SPDX License. You can download it from GitHub.

The PHP Interpreter

            kandi-support Support

              php-src has a medium active ecosystem.
              It has 35555 star(s) with 7562 fork(s). There are 1418 watchers for this library.
              It had no major release in the last 6 months.
              There are 360 open issues and 1206 have been closed. On average issues are closed in 45 days. There are 322 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of php-src is php-8.0.29

            kandi-Quality Quality

              php-src has 0 bugs and 0 code smells.

            kandi-Security Security

              php-src has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              php-src code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              php-src has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              php-src releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.
              It has 36441 lines of code, 5687 functions and 691 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of php-src
            Get all kandi verified functions for this library.

            php-src Key Features

            No Key Features are available at this moment for php-src.

            php-src Examples and Code Snippets

            No Code Snippets are available at this moment for php-src.

            Community Discussions


            Is it possible to pass PHP variable to FFI C function?
            Asked 2022-Feb-19 at 16:32

            I want to explore PHP variables on C level with FFI. Is it possible?
            I wrote code, but it doesn't work correctly.




            Answered 2022-Feb-19 at 16:32

            You can't pass PHP variable to FFI C function, but you can access that variable in C code:




            How to get the status message set by http_response_code in PHP
            Asked 2021-Dec-19 at 13:26

            The http_response_code function sets the header to the defined code and corresponding message from this map http_status_codes.h.

            Is it possible to get the message?



            Answered 2021-Dec-19 at 13:26

            Under Apache, you may try with apache_request_headers(). Otherwise, that information might well not be available at all (i.e. sent directly to whatever HTTP serving tier is there, out-of-band and unseen from ob_* functions).

            I don't think a definite general answer is possible without delving into the actual source code though.



            how to get DOMDocument when compiling PHP7.4 from source?
            Asked 2021-Dec-03 at 16:49

            how do you get DOMDocument when compiling php7.4 from source? i'm on Amazon Linux 2 and compiling php7.4 like this:



            Answered 2021-Dec-03 at 16:49

            when compiling with --disable-all, you need both --with-libxml and --enable-dom for DOMDocument to be available.



            how to undo the actions of "make install"?
            Asked 2021-Nov-23 at 21:58

            Is there a way to undo the actions of sudo make install? That is, remove the files that were copied to the /usr/local/bin folder?

            I built PHP from source using the following commands:



            Answered 2021-Nov-23 at 21:58

            make install is not a constant command that magically install a C project. It follows a spec. file that contains instructions to how make should behave that's called a "Makefile".

            In order to undo what make install did, you must read the Makefile that's located under the project's root directory. see what install target does and create (if doesn't exist) a target (eg. uninstall) that reverses all that install does. (eg. remove installed file, detach Kernel hook, ...etc.).



            Why is my output buffer flagged as 'disabled' by PHP?
            Asked 2021-Nov-05 at 11:31

            My previous question (ob_get_status() has undocumented bits set in 'flags' entry) revealed that there are some undocumented flags that may be passed into output buffer callback functions (i.e. the function specified when setting your output buffer, using ob_start()).

            One of these flags (undocumented, but revealed by the PHP source code) is PHP_OUTPUT_HANDLER_DISABLED and this is what I am receiving when I call ob_get_status(true) in my application.

            My question is, what are the situations that can cause an output buffer to be marked as disabled?

            (Note that I am asking in the general case, rather than specifically asking about my code, as I feel that too much context would be required to give a specific answer. If I understand the possible reasons, I hope I can deduce which of them might apply in my situation.)



            Answered 2021-Nov-05 at 11:31

            I think I've cracked it!

            It looks like there is a bug in PHP >= 5.4 that affects the way false is handled when returned from an output buffer callback function after a 'clean' operation.

            The documentation states:

            If callback returns false original input is sent to the browser.

            This statement implies that the following two callbacks are always identical:



            Implement Php open_ssl_decrypt AES 256 CBC as CryptoJS
            Asked 2021-Feb-05 at 09:23

            I try to make the following code in ReactJs (not NodeJs) but this doesn't work in JS.

            The original code in PHP works fine:



            Answered 2021-Feb-05 at 09:23

            The PHP implementation uses EVP_BytesToKey() as key derivation function and is thus compatible with the CryptoJS key derivation.

            However, CryptoJS applies MD5 as digest by default, while the PHP code uses SHA256 (note that OpenSSL has changed the default digest from MD5 to SHA256 as of version v1.1.0).
            Moreover, the password applied for the key derivation function is not the password itself (i.e. Nootric2703202) but the hex encoded SHA256 hash of the password.

            If this is taken into account, decryption with CryptoJS is:



            Json Patch: Append multiple?
            Asked 2020-Dec-20 at 08:13

            Basically, how can I can combine these two operations?



            Answered 2020-Dec-20 at 08:13

            This is not possible - the Json Patch spec only allows for adding singular values.



            Are PHP session writes atomic?
            Asked 2020-Oct-28 at 07:14

            As PHP session handler was somehow flawed in the past, we developed a homemade session handler years ago. But it seems that current versions of PHP are well developed and flaws are gone, and we decided to use PHP's default session handler (as it is much faster than our handler which uses dbms to save session data - which sometimes have to read/write megabytes of data).

            The only question which we couldn't find an answer for is if PHP's default session handler is atomic or not?

            We know that the session files are locked so are prone to race condition, but what about atomicity? What if megabytes of data are going to be saved in a session file, and some errors happens in the middle (power outage, crash or disk failure for example). What happens now? are session data corrupted now? Or old data are still in place?

            We don't have a C programmer in our team, but I looked in PHP's source code and I found the line that is responsible for writing sessions to files, but I was unable to find s_write()'s source code's file.



            Answered 2020-Oct-28 at 07:14

            After some digging in the source, I've found the function that writes the data to the disk.

            3 functions can be used by ps_files_write to write data:

            • _write, on Win32
            • prwite, which seems to be a UNIX function, I don't know much about that one honestly.
            • write, the basic C system call.

            As per the links above, all of them are "atomic" in the way that they do not flush the write buffer if an error has been encountered (not enough disk space, unauthorized access, locked file, etc.).

            ps_files_write returns an status value (either SUCCESS or FAILURE) which is then later on checked in php_session_save_current_state to return an ERROR to the PHP script.

            So yes, generally you can consider session writes to be "atomic", even though on some cases you will not be able to guarantee it (if the power is cut suddenly, the system stops within microseconds, so nothing can be saved...).



            PHP : Don't understand extension system
            Asked 2020-Aug-05 at 19:49

            I recently needed to do multithreading with PHP so I compiled version 7.4 from source to have ZTS mode enabled (required to use Parallel new extension) :

            • I cloned the PHP source repo on my server

            • git checkout PHP-7.4

            • ./buildconf --force

            • I took this configuration string from a tutorial, I have to admit that I didn't really understand all the options :

              CONFIGURE_STRING="--prefix=/etc/phpzts --with-bz2 --with-zlib --enable-zip --disable-cgi
              --enable-soap --enable-intl --with-openssl --with-readline --with-curl --enable-ftp
              --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-sockets
              --enable-pcntl --with-pspell --with-enchant --with-gettext --with-gd --enable-exif
              --with-jpeg-dir --with-png-dir --with-freetype-dir --with-xsl --enable-bcmath
              --enable-mbstring --enable-calendar --enable-simplexml --enable-json --enable-hash
              --enable-session --enable-xml --enable-wddx --enable-opcache --with-pcre-regex
              --with-config-file-path=/etc/phpzts/config --with-config-file-scan-dir=/etc/phpzts/config
              --enable-cli --enable-debug --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data
              --with-mcrypt --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-shmop --enable-parallel

            • ./configure $CONFIGURE_STRING

            • make && make install

            • copied php.ini file from the php-src repo to phpzts/config (confimed it was loaded successfully by doing a /etc/phpzts/bin/php --ini)

            All the functions that are supposed to be loaded from php extensions work well in my scripts, especially mb_string functions, openssl functions, parallel functions. That's what I don't understand. I was expecting to install them through apt-get install php7.4-mbstring for exemple, just like what I do with the other php installed for apache. All the extensions are commented in the php.ini file template that I just copied from the source repo :



            Answered 2020-Aug-05 at 19:49

            You have compiled the modules static to the php binary. Look here

            As you already know from the previous section, PHP extensions can be either built statically into the PHP binary, or compiled into a shared object (.so). Static linkage is the default for most of the bundled extensions, whereas shared objects can be created by explicitly passing --enable-EXTNAME=shared or --with-EXTNAME=shared to ./configure.



            Kubernetes overlay mounts and rsync
            Asked 2020-Jul-29 at 23:41

            I'm trying to tweak my Kubernetes-based app to make it more development-friendly. I'm using kustomize to add some extra containers into my app-deployment. It looks like this:



            Answered 2020-Jul-29 at 23:41

            No, Kuberentes mounts, unlike Docker mounts do not allow mounting one directory over the other. Potential VOLUME lines from the Dockerfile do not matter.

            A common solution for your use-case is, to use an init container to set up the emptyDir, before the main container is started. So basically you specify the emptyDir as a volume mount in both the init container and the main container and have the init container copy the files into the emptyDir.

            Additionally, there are two projects that offer different solutions to what you are trying to achieve:

            Using one of those you would not need the custom rsync and init container setup in your overlay.


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install php-src

            You can download it from GitHub.


            The PHP manual is available at
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone php/php-src

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link