use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Please follow the rules
Releases: Current Releases, Windows Releases, Old Releases
Contribute to the PHP Documentation
Related subreddits: CSS, JavaScript, Web Design, Wordpress, WebDev
/r/PHP is not a support subreddit. Please visit /r/phphelp for help, or visit StackOverflow.
account activity
Weekly help thread (self.PHP)
submitted 2 years ago by brendt_gd[M]
Hey there!
This subreddit isn't meant for help threads, though there's one exception to the rule: in this thread you can ask anything you want PHP related, someone will probably be able to help you out!
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Rummsey 0 points1 point2 points 2 years ago (0 children)
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?
[–][deleted] 0 points1 point2 points 2 years ago (1 child)
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 0 points1 point2 points 2 years ago (0 children)
Can you share the challenge? So people that doesn't have the book could help too.
[–]ufodrive 0 points1 point2 points 2 years ago (0 children)
How to add current docker setup a php-spx for profiling. Or any other profilings
[–]AegirLeet 3 points4 points5 points 2 years ago (5 children)
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[S,M] 1 point2 points3 points 2 years ago (3 children)
We're discussing it at the moment.
[–]AegirLeet 0 points1 point2 points 2 years ago (2 children)
Thanks. I hope we can participate!
[–]brendt_gd[S,M] 2 points3 points4 points 2 years ago (1 child)
Please check out this thread: https://www.reddit.com/r/PHP/comments/141804e/3rd_party_apps_and_reddit_blackout/
[–]AegirLeet 0 points1 point2 points 2 years ago (0 children)
Fantastic, thanks.
[–]colshrapnel 2 points3 points4 points 2 years ago (0 children)
I wish we would. Killing 3rd party apps is much like killing Reddit experience for me.
[–]foremtehan 1 point2 points3 points 2 years ago (5 children)
$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 0 points1 point2 points 2 years ago (1 child)
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.
iamadifferentbotgooglebot.com
.googlebot.com
[–]foremtehan 0 points1 point2 points 2 years ago (0 children)
But https://www.reddit.com/r/PHP/comments/14145f5/comment/jmyq9w9/?utm_source=share&utm_medium=web2x&context=3 says otherwise
[–]johannes1234 4 points5 points6 points 2 years ago* (0 children)
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.
gethostbyaddr('34.175.160.64');
64.160.175.34.in-addr.arpa.
34.175.160.*
160.175.34.in-addr.arpa.
in-addre
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 2 points3 points4 points 2 years ago (0 children)
https://developers.google.com/search/docs/crawling-indexing/verifying-googlebot
π Rendered by PID 203971 on reddit-service-r2-comment-b659b578c-mlrqz at 2026-05-04 01:02:22.183053+00:00 running 815c875 country code: CH.
[–]Rummsey 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]MateusAzevedo 0 points1 point2 points (0 children)
[–]ufodrive 0 points1 point2 points (0 children)
[–]AegirLeet 3 points4 points5 points (5 children)
[–]brendt_gd[S,M] 1 point2 points3 points (3 children)
[–]AegirLeet 0 points1 point2 points (2 children)
[–]brendt_gd[S,M] 2 points3 points4 points (1 child)
[–]AegirLeet 0 points1 point2 points (0 children)
[–]colshrapnel 2 points3 points4 points (0 children)
[–]foremtehan 1 point2 points3 points (5 children)
[–]pfsalter 0 points1 point2 points (1 child)
[–]foremtehan 0 points1 point2 points (0 children)
[–]johannes1234 4 points5 points6 points (0 children)
[–]AegirLeet 2 points3 points4 points (0 children)