I kept getting this while run php artisan migrate SQLSTATE[42000]: Syntax error or access violation: 1091 Can’t DROP ’email’; check that column/key exists While I see that email is exist on my database. My migration script. I was trying to drop the unique constraint. Did I forget to clear any caches ? Any hints for me ? Answer When dropping
Why isn’t my PHP exception working?
I am new to exceptions in PHP or any language really. I am trying to catch an exception if a user enters an invalid textual timezone (“xxxxxxxxxx” in this case). My test case is definitely invalid as an exception is triggered, just not the catch logic which is supposed to handle it intelligently. Basically I want it to use a
Php Filter array
I need a simple example of php filter array. This function is new for me so please I can’t understand complex program of it. I want to store filtered data to the database from a simple form where …
file_get_contents(): Peer certificate did not match
I used PHP 5.5 but I forced to update it and now I’m using PHP 5.6.19. Now, when I’m trying to communicate with external API I get warning: Warning: file_get_contents(): Peer certificate CN=*….
PHP global variable available to application and other users
PHP Global Variable Are they available application wide e.g: if they are created on index.php are they values available in file.php Is the value of the global variable same for each user. Say I have …
Add an empty line at end of file according to PSR-2 on PhpStorm
I use PSR-2 for code styling my code. When I inspect a file using Codesniffer most of the times I get the following error. 332 | ERROR | [x] Expected 1 newline at end of file; 0 found It’s …
DOMPDF Chinese Character
I have problem that when I download the PDF it will download the font together in the PDF which will create a very big size of PDF (about 10mb+). Answer You’ll want to enable font subsetting. In dompdf 0.6.2 or earlier set the DOMPDF_ENABLE_FONTSUBSETTING configuration constant to true. Configuration constants can be set in dompdf/dompdf_config.custom.inc.php. In dompdf 0.7.0 or later
PHP Resolving URL format with Base URL Relative Path into Absolute
I get some html code from other website. Using Bellow Code From Here I get like this code I get all the href attribute by using Regex. Now all this links has no domain and paths But I want to get all this links like bellow(I hope all links are format link this) How can I transform relative path into
PHP date.timezone not found with Docker & PHP-FPM
I’m creating a Symfony environment (PHP-FPM, Nginx, & more) with Docker & Docker-compose. But, PHP does not use my php.ini and ignores the config (date.timezone parameter is not found in my …
set urls with parameter to noindex in wordpress?
I’m looking for a solution to set all URLs which uses the parameter ‘?’ to noindex. I look for a php solution which I could use in the header.php in Wordpress or in the .htaccess. I tryed this: This solution did not work and URLs with the parameter ‘?’ didn’t get a noindex attribute. Best regards Answer You can use