php

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

raoul, in Help installing PHP on Ubuntu (Solved. Thank you!)

Maybe there is a conflict between libapache2-mod-php and php-cgi?

According to your doc, it seems to be one or the other.

GardenVarietyAnxiety,

I wiped and reinstalled everything php and apache… It still didn’t work, so I tried to simply put

<?php phpinfo();

as suggested by someone else …and it works now? I reverted my .php file to what I listed in my op and that works now, too.

Oi.

lemmy_in, in I have suddenly inherited a PHP project. What VSCode extension or server is best for developing it locally? I’m down with any other suggestions too!

Jetbrains Phpstorm is probably best in class, but you’ll have to pay for it.

sjpwarren,

I don’t do PHP. But I used other JetBrains tools for Go, Python and Java and they are very helpful. The AI Assistant is pretty good for explaining code. I am not in anyway paid by them. Good Luck

monomon, in I have suddenly inherited a PHP project. What VSCode extension or server is best for developing it locally? I’m down with any other suggestions too!
@monomon@programming.dev avatar

ddev saved my life when I inherited a drupal project.

tsonfeir, in I have suddenly inherited a PHP project. What VSCode extension or server is best for developing it locally? I’m down with any other suggestions too!
@tsonfeir@lemm.ee avatar

A lot depends on how the PHP site was set up. Does it have requirements? Apache? What version? MySQL? Is it using a framework? Composer, hopefully?

Theoretically all you need is PHP installed. You can run it from the command line with -S… maybe.

More information would be helpful.

gofsckyourself,

Seconded.

Also, what OS are you on?

For Windows, Laragon is super easy and convenient.

Or Devpod might be a good choice, too.

shnizmuffin, in I have suddenly inherited a PHP project. What VSCode extension or server is best for developing it locally? I’m down with any other suggestions too!
@shnizmuffin@lemmy.inbutts.lol avatar

Here’s hoping you have Docker installed, because Laradock rules. (It’s not just for Laravel.)

If the project is a Laravel project, Laravel Herd just came out. If you’re on a Mac, there’s also Valet. If you prefer a VM, there’s Homestead - a PHP Vagrant config.

tsonfeir, in PHP Weekly - March 6th 2024
@tsonfeir@lemm.ee avatar

2024 and we still can’t get mobile right.

dan, in ActivityPub Server in a Single PHP File
@dan@upvote.au avatar

Seems like decent example code.

Technically any PHP site could be in a single file. You can even embed images if you base64 encode them.

I guess what they mean is a single file with a reasonable size.

Dirk, in ActivityPub Server in a Single PHP File

Again, this is not suitable for any real world use. This is an educational tool

This is a fully usable bot-in-a-box for Mastodon, you say? Thank you! 😇

shnizmuffin, in Improve my code - function to sanitize input fields
@shnizmuffin@lemmy.inbutts.lol avatar

You’d probably get more feedback if you posted a proposed solution (or “correct answer”) to StackOverflow and let the community tell you how dumb you are in between generating exactly what you are looking for.

amargo85,

dumb Lol

shnizmuffin,
@shnizmuffin@lemmy.inbutts.lol avatar

Real answer: consider passing Markdown through instead. You’re getting really close to one of my favorite memes. It’s a dark path, don’t tread down it.

amargo85,

which programming languages do you master? i’d actually like to work with you

shnizmuffin,
@shnizmuffin@lemmy.inbutts.lol avatar

“Master” is a strong word, but when I have to build applications it’s PHP in the back and JS up front. Specifically, Laravel implementations with whatever on top.

I’m extremely proficient with templating languages that eventually turn into HTML (nunjucks, antlers, blade, handlebars, webc, vue) and CSS (SCSS, LESS). A ton of my work winds up being on Static Site Generators and the unholy abomination that is at-scale Email development.

amargo85,

man! you’re good at this

fartsparkles, in Library validate against graphql schema

I’d be interested in something like this for any language. Would be immensely useful!

dbx12, in Welcome to /c/PHP!

Hey, I’ve came over from Reddit and thought I’ll introduce myself as well. As every programmer, I’ve started way too many pet projects and almost all of them are starving. In terms of framework, I prefer Yii2 over Laravel every day. I feel like Laravel provides you a dozen different (seemingly equally good) ways of doing something. You could say it’s lacking clarity or guidance for the developer.

mbd,

Hey, welcome! Classic haha, I have far too many pet projects as well 😅

And yeah agreed, it’s a bit dizzying to choose a Laravel “path”. Would probably be helpful to have a documentation page sort of like the Remix Stacks where they talk a little bit about which “path” to choose depending on app needs.

dbx12,

Docs is another topic I really don’t like about Laravel. Why don’t you have a simple API doc with available functions and their parameters instead of that blog-style documentation. And no, I don’t want to watch a video about how to use X, I want to know what functions I can call. Oh and don’t get me started on all their global “helper” functions.

Buddhist1961,
@Buddhist1961@programming.dev avatar

This is not a comment trying to convert you to Laravel, but if you or anyone else is interested, an API doc actually exists and is available here.

shnizmuffin, in FrankenPHP v1.0 is Here
@shnizmuffin@lemmy.inbutts.lol avatar

As someone who just spent weeks (months?) properly containerizing all his PHP applications with laradock: “Fuck.”

spartanatreyu, in Changes you would love to see in PHP?
@spartanatreyu@programming.dev avatar

This one right here: wiki.php.net/rfc/consistent_function_names

Right now the only reason I ever use php is because I have to.

This one simple change would bring me half way to wanting to use php for fun (the other half would be making debugging easier).

prwnr,

Could you wrote more about that debugging? I’m curious what you find not easy.

spartanatreyu,
@spartanatreyu@programming.dev avatar

Mainly because you’ve got to setup PHP to be debuggable in the first place.

And setting up PHP is already a hassle. When a dev has to set up php in about 5 separate ways just to figure out which one is actually debuggable, then PHP has a problem.

tsonfeir, in Exploring stdClass in PHP
@tsonfeir@lemm.ee avatar

Holy hell no.

The code you provided could be risky because:

No Data Checking: It directly uses data from an API without checking if it’s safe or correct.

Dynamic Properties: Adding properties to an object on the fly can make the code hard to manage.

External Data Dependency: Relying on API data structure without checks can lead to issues if the API changes.

If you don’t know the data is safe (it’s not), it’s a lot better to use an associative array. Additionally, if it’s from a json, it’s quicker and easier to iterate over array. Don’t make it complicated for no reason.

buzz, in Symfony 7.0.0 released (Symfony Blog)
@buzz@lemmy.world avatar

Add native swoole suppport

  • All
  • Subscribed
  • Moderated
  • Favorites
  • php@programming.dev
  • random
  • meta
  • Macbeth
  • All magazines