Questions tagged [php]

PHP is a free server-side, general-purpose scripting language that is especially suited for web development. Originally PHP stood for Personal Home Page, now it stands for PHP: Hypertext Preprocessor.

Filter by
Sorted by
Tagged with
0 votes
1 answer
28 views

Dynamic PHP Pages [closed]

I'm trying to make a database of herbs with their many uses. Instead of making an individual page for every single one of them, I would like to just put the info in MySQL and call it to their ...
user avatar
1 vote
0 answers
34 views

Why does Dreamweaver save the same .php file twice?

I am creating a website on localhost (WAMP) as of now. I have set up the testing server the new php files that I create are saved in a sub-foldor of www folder specific for my website. [ C:\wamp64\...
user avatar
2 votes
1 answer
142 views

Cloudflare returns 200 when server returns 404

When I make a request to my site that is proxied through Cloudflare, if I am requesting a resource that doesn't exist (such as /foo), my server returns a 404 (I see my 404 page and testing without ...
user avatar
  • 41
7 votes
2 answers
966 views

HTTP2 is enabled and working, but PHP $_SERVER['SERVER_PROTOCOL'] still says "HTTP/1.1"

I've been migrating to a new host (AWS Lightsail with a Ubuntu instance) and while everything is working just fine I'm running into a quirk that I can't quite figure out. I've enabled HTTP2 on my ...
user avatar
1 vote
1 answer
2k views

my laravel sub-domain urls does not work except homepage

I am new to hosting web apps online. I wanted to host an app in my subdomain eg departmennt1.example.com. I added the subdomain in cPanel. Located its directory in file manager. It happens that the ...
user avatar
  • 31
1 vote
1 answer
100 views

Internal Server Error caused by rewriting [closed]

Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.html -f RewriteRule ^(.*)$ $1.html [NC,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{...
user avatar
1 vote
0 answers
19 views

Monthly search value in adwords api is much larger then in a Keyword Planner

I am trying to use an adword api to get some keyword statistics. But what I see is that with a same parameters my monthly search volue is about 7 mln searches. While adword keyword planner shows ...
user avatar
1 vote
2 answers
76 views

What happens when someone fills in a contact form on a website?

I am trying to debug a problem on a wordpress website I am working on. The contact form doesn't work. In my quest to find answers it occurred to me that I don't even actually know what's going on in ...
user avatar
  • 133
0 votes
1 answer
188 views

Can a 410 gone page remain indexed?

Does somebody experienced a page with 410 status code in index? Could you imagine, that an indexed healthy page, which is set to 410 only through adding of <?php header( "HTTP/1.1 410 Gone&...
user avatar
  • 9,599
0 votes
1 answer
48 views

Blacklisted IPs visiting my site

I have a website and I wanted to see what volume of traffic I was receiving, using $_SERVER['REMOTE_ADDR']. However, when checking these IP addresses against blacklisting services I found that around ...
user avatar
0 votes
0 answers
30 views

Update "hosts" file on CentOS server with cPanel

I'm migrating from an old server to a new server running cPanel/WHM v86.0.18 and I'm in the process of migrating and testing two websites, let's say example.com and web.example.com. These two websites ...
user avatar
  • 21
1 vote
1 answer
172 views

How can a search engine crawl a dynamically generated website?

A dynamically generated website doesn't have most of its content hard coded on the HTML file. Sometimes it waits for a user to login or wait for an input to generate its views. So it would look ...
user avatar
-1 votes
1 answer
36 views

What is the difference of an `if` statement that has an {open-close} brackets, and without {open-close} brackets [closed]

if statement has an open {} close brackets if(example){ return example; }else{ return example; } if statement without open {} close brackets if(example) return example; ...
user avatar
1 vote
1 answer
225 views

Lighttpd - configure multiple PHP versions

I have 2 php fpm services in my server, one is php 5.6 in port 9001, and the other is php 7.2 in port 9072. I have a website that is running on PHP 5.6, working using the following config: fastcgi....
user avatar
  • 111
2 votes
0 answers
18 views

Geo specific content and CDN caching [closed]

Our Wordpress website has a list of products which is generated on the server side. Depending on user ip (country) the list gets populated with different items. Some products are meant to be displayed ...
user avatar
1 vote
0 answers
43 views

Which PHP extensions do most web hosts commonly have installed and enabled?

I'm building a WordPress plugin intended for wide release, and would like to be able to rely on the openssl and gmp extensions, which require that PHP was compiled with those extensions specified and ...
user avatar
  • 123
1 vote
0 answers
18 views

Is it possible to create mysql accounts for 'user' and have that account access a different page of the website? [closed]

I'm creating a website where me "as an admin" can create other accounts for "users". When I login as an admin it will be directed to a page like "superuser.php" where I can create an account for "...
user avatar
1 vote
0 answers
340 views

How can a file download link download an old file that doesn't exist?

Early last year, I created a website that parses a CSV file and parses / displays it in a certain way for internal use. One page of this website provides an upload / download function so that the CSV ...
user avatar
  • 121
3 votes
1 answer
738 views

Hide the subfolder from appearing in url

I want to move from www.example.com/_/randomfolder to example.com/randomfolder. It should acces the contents from /_/randomfolder but should show example.com/randomfolder. What I have tried: Trial 1 ...
user avatar
1 vote
1 answer
27 views

I am looking for a way to set noindex tags on all the string filters parameters

I don't want to use robots.txt for this. Any PHP code or any .http access lines will work like a charm. Now I show you what types of urls I want to eradicate. https://www.example.com/search-gadgets/?...
user avatar
1 vote
1 answer
420 views

Have Google index different languages at the same URL instead of just the default (English)

I have a multilingual PHP site. I have set English as the default language. The language changes automatically according to the browser settings. If it is French, the site will be seen in French. ...
user avatar
  • 11
1 vote
1 answer
84 views

CDN cached PHP page vs HTML one - Loading speed

Is there any difference at all in terms of loading speed if we have a fully cached PHP generated site (by for example, using CloudFlare rules "Cache everything") and a HTML page? Cloudflare allows ...
user avatar
  • 317
2 votes
1 answer
30 views

Updated MediaWiki to version 1.31. Now Spam Blacklist and Title Blacklist are causing errors

I had (I think) version 1.23 because that's what the auto-installer on my host put there. So I uploaded the files for 1.31 and ran the update.php script. The site seemed to run fine until I tried to ...
user avatar
1 vote
2 answers
365 views

Handling extended Latin characters in URLs correctly with PHP and percent-encoding

I am currently tying myself up in knots over URL percent-encoding of extended Latin characters. Step 1 of 4 I have the following URL: https://example.com/fußgängerbrücke/ The offline folder name (...
user avatar
1 vote
1 answer
366 views

Removing Some Content from website by giving 410 status code

I have some content to be permanently deleted from my website. This is a permanent deletion and I am planning to give 410 status code. I can very well return the status code in PHP page as header( "...
user avatar
  • 177
1 vote
0 answers
158 views

Use .htaccess/SSH/Cpanel to prevent a specific part of a specific PHP script from being processed

I have a website built with MediaWiki CMS which I host on a CentOS based Apache "shared server environment" (SiteGround) in which I can partially control Apache by: .htaccess files SSH Some Cpanel ...
user avatar
2 votes
1 answer
818 views

How To Create An Exception, or or exclude certain files from a php-file-extension Snippet in .htaccess? this example failed

This is a .php file extension removal snippet, for displaying links online. RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC] RewriteRule ^ %1 [R,L] This is where I make an exception to ...
user avatar
  • 23
2 votes
1 answer
248 views

I'm using PHP 7.1 but Hostgator says they are on 5.4, and Cron throws an error

Trying to make sense of this. Doing a quick phpinfo() I get: PHP Version 7.1.14 System Linux gatorxxxxx.hostgator.com n.nn.nnn-nnn.nnn.nnn.x86_64 #1 SMP Tue May 21 13:24:40 CDT 2019 x86_64 But ...
user avatar
  • 141
0 votes
0 answers
9 views

Please I want to Restructure this php URL to SEO friendly URL [duplicate]

I have this is the listing page: <div class="group"><a href="/category?id=<?php echo $data->slug;?>"><?php echo $data->title; ?></a></div> I have this https:/...
user avatar
5 votes
2 answers
134 views

I'm using a public device vs Keep me signed in

I know this might be an obvious question, but its escaping me. When logging on websites, I have seen check boxes for things like "i'm using a public device" and "Keep me signed in". I know keep me ...
user avatar
  • 153
1 vote
1 answer
44 views

How redirect directly to the final domain URL rather than a chain through variations of `www` and `https`?

When I type example.com in the URL it first redirects to http://example.com then to https://example.com and finally to the https://www.example.com (the original address). Why doesn't it straight away ...
user avatar
1 vote
2 answers
2k views

Need help setting canonical within PHP

First, I want to preface that I am not very good with php so I am looking for some guidance. I'm working on a website using Dreamweaver that is being accessed through .davaccess each php page has ...
user avatar
  • 531
1 vote
1 answer
416 views

How to fix "Missing a temporary folder" error in Wordpress?

Today I pushed to live (using Softaculous) a staged version of my WordPress website which was working perfectly. Afterwards, the only thing that doesn't work properly is uploading files/media. The ...
user avatar
1 vote
0 answers
2k views

Phone number on wordpress website magically being changed to different number [closed]

I have a very strange problem on the website of a client of mine. It's a wordpress website I have designed with a child theme of the Leisure theme. I have coded a couple of simple plugins to suit ...
user avatar
3 votes
0 answers
125 views

405 for POST requests, download triggered for GET requests for specific php file only

Apologies, I know this is a basic question, but I'm learning nginx! I've inherited a Nginx driven site, the problem is that when browsing to a specific php file it initiates a download. The file, ...
user avatar
  • 31
6 votes
3 answers
1k views

Why can't update.php connect to my database when my site connects to it just fine?

I'm trying to upgrade my MediaWiki installation. My site runs just fine locally at http://localhost:8888/. I can connect to my database using the "Socket" connection on Sequel Pro on port 8888. My ...
user avatar
1 vote
0 answers
22 views

I am trying to make a file upload form for my website, I have some code but it is not working [closed]

I cannot get this to work am I doing something wrong? $extensions= array("jpeg","jpg","png"); if(in_array($file_ext,$extensions)=== false){ $errors[]="extension not allowed, please choose a ...
user avatar
3 votes
2 answers
160 views

Change the product URL to a directory and drop the PHP to put articles about the product within its URL structure?

I have a product with url http://example.com/category/product.php. In short will come some blog articles, having urls like http://example.com/category/product/article1/, http://example.com/...
user avatar
  • 9,599
1 vote
0 answers
31 views

Getting weird, process.php hits on my rails based site. What is this an indication of? [closed]

I was looking in my google analytics and discovered a few php hits to pages that, as a rails site obviously not apart of it. Here's an example: /process.php?d=WnCeik5EGhC5sO5YToPnII5eaQ==&b=1 ...
user avatar
3 votes
1 answer
548 views

PHP 7.3 doesn't show in Web Platform Installer (WPI) in IIS 8.5

I have 3 Windows servers, two of them are Windows Server 2012 R2 - IIS 8.5 and the other is Windows Server 2012 - IIS 8.0. I wanted to update to PHP 7.3.x automatically through the Web Platform ...
user avatar
2 votes
1 answer
42 views

I can't run 2 or more url rewriting rules at once

I was trying to shorten the URL more, but I was removing .php file extension from the URLs using URL rewriting too. I can't run both at the same time. Removing the extensions and trying to shorten ...
user avatar
1 vote
0 answers
1k views

How to fix .htaccess error? Keeps asking for authentication

I'm setting up basic http authentication for my subdomain dev Laravel site with .htaccess and .htpasswd. First, I created my .htpasswd user and password by command htpasswd -bc .htpasswd admin ...
user avatar
-3 votes
1 answer
66 views

Why does my website say that I can not update to Wordpress 5.2.2 because my php is out of date

I can not update to wordpress 5.2.2, I am receiving a message that says You cannot update because WordPress 5.2.2 requires PHP version 5.6.20 or higher. You are running version 5.4.45. While ...
user avatar
1 vote
0 answers
26 views

Selecting a forms “select” option based on referring URL [closed]

I have a seemingly simple question that I can’t find an answer for. Scenario: I am developing a ”single-page” website based on a HTML5 UP! template that shows/hides content after clicking a button ...
user avatar
1 vote
1 answer
125 views

How to stop google from indexing old URLs of a website which redirects to new URLs

My old WordPress configuration added index.php to the permalinks of all my pages. e.g: https://example.com/index.php/contact etc., It was indexed already by google crawler. Now I reconfigured ...
user avatar
1 vote
1 answer
52 views

Debian Server Upload-Limit via PHP and SFTP

do you know where upload limits can be set on a debian server running apache2 and php7 outside of php? Problem: Can't upload files bigger than ~2MB Tried solutions: configuring php.ini (both ...
user avatar
  • 11
0 votes
2 answers
1k views

Do browser developer tools expose your PHP code?

Browser "development tools" are a great way to learn from others, but are they a security risk? I'm working on a project using PHP. My understanding is that PHP code is hidden. So, someone calling for ...
user avatar
  • 811
2 votes
1 answer
124 views

How can I resolve htaccess causing social media bots to see 404 response even though the page displays correctly?

I use the below htaccess code which appears to function correctly to rewrite URLS, however when a page is shared to social networks or scanned by bots like AHREFs, they all return 404 yet the pages at ...
user avatar
  • 41
1 vote
1 answer
212 views

MediaWiki: Hiding certain HTML elements for non-logged-in users

In a MediaWiki-based non-communal website there are some HTML elements that should be presented only for logged-in-users (an administration menu or some of its links). Usually if I want to hide ...
user avatar
0 votes
1 answer
170 views

PHP randomly cannot load classes, causes FastCGI process to crash, and loads normally

I manage the website for the small company I work for, but I’m not an experienced server admin – I just kind of took over as the default IT guy because I knew more than the others. Generally speaking, ...
user avatar

1
2
3 4 5
23