When you're using the visual and database components of Lazarus there is no easy converter to PHP, as far as I know.
For the drag and drop (using visual and database components) there is RadPHP (formerly Delphi for PHP) like I already mentioned. It uses the opensource
VCL4PHP framework (the RadPHP is just the IDE for development, you could of course use a text-editor instead but I wouldn't recommend it). I'm not sure VCL4PHP is even actively maintained anymore. There is another framework like VCL4PHP (which still is active) and that's
Prado. I haven't found an IDE which supports this one though. But anyway... for both these frameworks you would need to know PHP for writing the actual events etc.
There is another option (which I only just found). That's
extpascal. You can see
a video here and
here. You said you're not after creating a cgi but that's the closest one I could find which would be helpful to you (i.e. showing the visual components on the webpage and still coding in pascal).