• New php project from scractch, PDO or psycopg?

    From ^Bart@none@none.it to comp.lang.php on Tue Feb 24 09:41:52 2026
    From Newsgroup: comp.lang.php

    Hello everyone,

    I work in a company 100% unix like, we don't have MS o.s., and our
    framework works with psycopg on debian13+venv.

    I'm working to a personal cms written from scratch alwasy on debian13
    with php8.4, postgresql18 and nginx, now I'm using psycopg so I have a different user for the php and another one for the venv etc.

    I heard psycopg for security reasons and also for the performance is
    better than pdo, tell me what do you think about it! :)

    ^Bart
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@arne@vajhoej.dk to comp.lang.php on Tue Feb 24 07:40:29 2026
    From Newsgroup: comp.lang.php

    On 2/24/2026 3:41 AM, ^Bart wrote:
    I work in a company 100% unix like, we don't have MS o.s., and our
    framework works with psycopg on debian13+venv.

    I'm working to a personal cms written from scratch alwasy on debian13
    with php8.4, postgresql18 and nginx, now I'm using psycopg so I have a different user for the php and another one for the venv etc.

    I heard psycopg for security reasons and also for the performance is
    better than pdo, tell me what do you think about it! :)

    psycopg is Python not PHP.

    Do you mean PDO or pgsql??

    Arne

    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From J.O. Aho@user@example.net to comp.lang.php,comp.lang.python on Tue Feb 24 15:39:36 2026
    From Newsgroup: comp.lang.php

    On 24/02/2026 09.41, ^Bart wrote:

    I work in a company 100% unix like, we don't have MS o.s., and our
    framework works with psycopg on debian13+venv.

    I'm working to a personal cms written from scratch alwasy on debian13
    with php8.4, postgresql18 and nginx, now I'm using psycopg so I have a different user for the php and another one for the venv etc.

    I heard psycopg for security reasons and also for the performance is
    better than pdo, tell me what do you think about it! :)

    I think this is more about layering the application, the frontend I
    guess is written in PHP while the backend is written in Python. I would
    keep that separation and only allow the backend to access the database,
    also keep it on a such level that the backend don't trust the data from
    the frontend, that all data is validated before use, sure the frontend shouldn't trust the users and validate their input.

    Sure you could have been able to write everything in one or the other
    language (python can do both frontend and backend, as you can do with
    php too even less common), but I doubt you have the power to decide this.

    --
    //Aho
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.lang.php,comp.lang.python on Tue Feb 24 20:29:03 2026
    From Newsgroup: comp.lang.php

    On Tue, 24 Feb 2026 15:39:36 +0100, J.O. Aho wrote:

    Sure you could have been able to write everything in one or the
    other language (python can do both frontend and backend, as you can
    do with php too even less common), but I doubt you have the power to
    decide this.

    You could make the case to your PHP-loving PHBs to write the whole
    thing in Python on the basis that it is a more sophisticated language,
    with built-in support for async/await, advanced libraries for
    convenient access to WebSocket functionality etc.

    And it doesnrCOt need to run as a module in a web server.
    --- Synchronet 3.21b-Linux NewsLink 1.2