{"id":13780792,"url":"https://github.com/iksteen/pyhp","last_synced_at":"2026-01-18T04:17:37.885Z","repository":{"id":35315242,"uuid":"39576791","full_name":"iksteen/pyhp","owner":"iksteen","description":"Embed the PHP interpreter in Python","archived":false,"fork":false,"pushed_at":"2016-01-25T14:38:28.000Z","size":18,"stargazers_count":13,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-03T18:15:24.820Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iksteen.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-23T15:55:41.000Z","updated_at":"2024-02-17T21:03:31.000Z","dependencies_parsed_at":"2022-09-17T06:30:38.014Z","dependency_job_id":null,"html_url":"https://github.com/iksteen/pyhp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iksteen%2Fpyhp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iksteen%2Fpyhp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iksteen%2Fpyhp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iksteen%2Fpyhp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iksteen","download_url":"https://codeload.github.com/iksteen/pyhp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225064399,"owners_count":17415239,"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":[],"created_at":"2024-08-03T18:01:19.791Z","updated_at":"2026-01-18T04:17:32.866Z","avatar_url":"https://github.com/iksteen.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"pyhp\n====\n\nThis extension allows you to embed a PHP interpreter into your python\nprojects.\n\nInstallation\n------------\n\nHow hard the installation will be depends on a number of factors:\n\n- Your OS.\n- Wether your distribution of PHP enables the php-embed SAPI mode.\n\nOn Ubuntu, you should *at least* install libphp5-embed and php5-dev, but\nyou will probably need to install some more development packages.\n\nHowever, you might need to compile your own PHP.. Don't forget to enable\nthe --with-embed=shared configure flag. You can safely disable all the\nother SAPI modules.\n\nOnce you have that covered, you can install this python extension using:\n\n.. code::\n\n    python setup.py install\n\nUsage\n-----\n\n.. code:: python\n\n    \u003e\u003e\u003e import pyhp\n    \u003e\u003e\u003e pyhp.evaluate('echo $foo;', {'foo': 'bar'})\n    'bar'\n    \u003e\u003e\u003e pyhp.execute('foo.php', {'foo': 'bar'})\n\nPretty much any object can be passed from python to PHP. None, strings,\nintegers, booleans, tuples, lists and dicts are first translated to\ntheir respective PHP type. Objects and callables are passed by a proxy\nwrapper which allows access to properties and function / method\ninvocation.\n\nWhen calling a python function from PHP code you can pass NULL, integers,\ndoubles, booleans, strings and arrays and they will be translated to their\nrespective python types. A heuristic is applied to PHP arrays to determine\nif the keys are sequential integers. If so, a list will be passed to the\npython callable. Otherwise a dict is passed. Passing PHP objects from PHP\nto a python callable is not supported. You can however pass proxied\npython objects back to python code.\n\nWhat people say\n---------------\n\n    tech2: excuse me while I get a hacksaw for my skull and a bottle of isopropanol.\n\n    Charlie_X: Personally, I'm quite happy to burn you at the stake for that little demon!\n\n    anonymous: Hurrah! An extra warm spot in hell for you. You've earned it.\n\n    bertjwregeer: Someone for the love of everything please explain why https://github.com/iksteen/pyhp exists. Embedding PHP in Python!!!\n\nLicense\n-------\n\n*pyhp* is distributed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiksteen%2Fpyhp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiksteen%2Fpyhp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiksteen%2Fpyhp/lists"}