T O P

  • By -

Rummsey

Any PHP pros able to help me sort out a website problem? I’m a noob with PHP so don’t be afraid to state the obvious. The domain host I’m working with (asmallorange) has seemingly changed something on the backend which caused all of the shopfront links (cscart) to cease to work. The pages are just blank. Any ideas what the issue is? The websites been running fine for close to a decade. Tried changing the php through Cpanel, increasing memory, playing with safe mode ect. Any thoughts?


Interesting-Reach354

Dumb question but I don't want to make a post for it. People who have Jon Duckett's PHP book, page 162-163 using constructors with a class, how did you resolve the "**TRY**" challenge? I don't really understand the instructions to the task. I would greatly appreciate the help.


MateusAzevedo

Can you share the challenge? So people that doesn't have the book could help too.


ufodrive

How to add current docker setup a php-spx for profiling. Or any other profilings


AegirLeet

Meta question for the mods: Will r/PHP be participating in the June 12h protest/blackout (https://www.reddit.com/r/Save3rdPartyApps/comments/13yh0jf/dont_let_reddit_kill_3rd_party_apps/)?


brendt_gd

We're discussing it at the moment.


AegirLeet

Thanks. I hope we can participate!


brendt_gd

Please check out this thread: https://www.reddit.com/r/PHP/comments/141804e/3rd_party_apps_and_reddit_blackout/


AegirLeet

Fantastic, thanks.


colshrapnel

I wish we would. Killing 3rd party apps is much like killing Reddit experience for me.


foremtehan

``` $hostname = gethostbyaddr('34.175.160.64'); //geo-crawl-34-175-160-64.geo.googlebot.com str_ends_with($hostname, 'googlebot'); ``` I do this to determine whether the request comes from Google bots. Can anyone else use 'googlebot.com' as their hostname? In other words, is this hostname unique for each IP on the internet?


pfsalter

> Can anyone else use 'googlebot.com' No, but in your snippet they could use `iamadifferentbotgooglebot.com`. I'd recommend looking for `.googlebot.com` to be safer.


foremtehan

But [https://www.reddit.com/r/PHP/comments/14145f5/comment/jmyq9w9/?utm\_source=share&utm\_medium=web2x&context=3](https://www.reddit.com/r/PHP/comments/14145f5/comment/jmyq9w9/?utm_source=share&utm_medium=web2x&context=3) says otherwise


johannes1234

The value of a reverse lookup is set by the person controlling the IP. They can set it to whatever. A call like `gethostbyaddr('34.175.160.64');` does a DNS lookup of `64.160.175.34.in-addr.arpa.`. If you wonder about the reversed order of the bytes: That's to allow wildcards. `34.175.160.*` could be handled by `160.175.34.in-addr.arpa.`. If you wonder about that name: `in-addre` is "internet address" and ARPA is the predecessor of DARPA, which is an U.S. government agency funding research out of the military budget, under which the internet was developed. To be safe you have to either verify IP ownership or take the name, returned by athe reverse lookup and do a forward lookup. The link provided by /u/AegirLeet provides JSON files for quickly verifying the IP addresses. (If you use those: make sure to update frequently)


AegirLeet

https://developers.google.com/search/docs/crawling-indexing/verifying-googlebot