List assignment with missing arguments in PHP [duplicate]

Is there an intelligent way to do list assignment, when some arguments are not present? I.e.:

[$a, $b] = [1, 2];
// $a=1, $b=2 - good

But how to assign conveniently when some arguments are missing:

[$a, $b] = [1];
// Warning: Undefined array key 1

[$a, $b ?? null] = [1];
// Fatal error: Assignments can only happen to writable values

[$a, $b ?: null] = [1];
// Fatal error: Assignments can only happen to writable values

This works, but error suppressing is bad, also $b default is lost.

$b = 'default';
@[$a, $b] = [1];

WordPress Theme Check error: file_get_contents found – how to fix with WP_Filesystem?

I’m using the PHP file_get_contents() function to retrieve and echo the contents of an SVG-file.

echo file_get_contents($icon_url);

I’m using the PHP file_get_contents() function to retrieve and echo the contents of an SVG-file.

I checked the theme with the WordPress.org theme checker and I am currently resolving all the issues. One of the issues is the use of file_get_contents.

file_get_contents was found in the file template-parts/sample.php File
operations should use the WP_Filesystem methods instead of direct PHP
filesystem calls.

Answers are appreciated to me, thanks for the help

LexikJWTAuthenticationBundle subscriber event wont trigg?

is anyone comfortable with the Lexik bundle?
I created a subscriber based on the AuthenticationSuccessEvent, but when I log in, it doesn’t go through my event, and I don’t understand why.

 providers:
        # used to reload user from session & other features (e.g. switch_user)
        app_user_provider:
            entity:
                class: AppEntityUser
                property: email
    firewalls:
        api:
            pattern: ^/api
            stateless: true
            entry_point: jwt
            json_login:
                check_path: /api/login # or, if you have defined a route for your login path, the route name you used
                success_handler: lexik_jwt_authentication.handler.authentication_success
                # success_handler: custom_auth_success_handler
                failure_handler: lexik_jwt_authentication.handler.authentication_failure
            jwt: ~
            refresh_jwt:
                check_path: /api/token/refresh # or, you may use the `api_refresh_token` route name
                # or if you have more than one user provider
                # provider: user_provider_name
            logout:
                path: api_token_invalidate

route.yaml :

api_login_check:
    path: /api/login

subscriber

<?php

namespace AppEventSubscriber;

use LexikBundleJWTAuthenticationBundleEventAuthenticationSuccessEvent;
use LexikBundleJWTAuthenticationBundleEventAuthenticationFailureEvent;
use SymfonyComponentEventDispatcherEventSubscriberInterface;

class TestLexikSubscriber implements EventSubscriberInterface
{
    public static function getSubscribedEvents(): array
    {
        return [
            AuthenticationSuccessEvent::class => 'onAuthenticationSuccessEvent',
            AuthenticationFailureEvent::class => 'onAuthenticationFailureEvent',
        ];
    }

    public function onAuthenticationSuccessEvent(AuthenticationSuccessEvent $event): void
    {
        // Debug to check if the event is triggered
        dd($event, 'success');
    }

    public function onAuthenticationFailureEvent(AuthenticationFailureEvent $event): void
    {
        // Debug to check if the event is triggered
        dd($event, 'fail');
    }
}

I just declared a subscriber with a dd on the event that’s passed as a parameter, and nothing happens — it constantly ignores the event…

Do you have any idea why?

Thanks!

My goal is to implement Two-Factor Authentication entirely in stateless mode.
The Scheb/2fa bundle only works with stateful sessions and I don’t want that.
I want to intercept the successful authentication and proceed with my own pipeline to set cookies on the client side, etc.

Laravel blade mail data not rendered

I have a mail view named passwordReset.blade.php like this

<!DOCTYPE html>
<html>
<head>
    <title>Wachtwoord Reset</title>
    <style>
        body {
            font-family: "Calibri", sans-serif;
            color: #000000;
            font-size: 0.9167em;
        }
        .token {
            color: #00a9b5;
            font-weight: bold;
        }
    </style>
</head>
<body>
    <p>Beste gebruiker van de ,</p>
    <p>
        Er is een aanvraag gedaan voor het herstellen van je wachtwoord. Ben je dit niet geweest dan mag je deze e-mail negeren. Voor het opnieuw instellen van je wachtwoord voer je de onderstaande code in bij de app:
    </p>
    <p class="token">
        {{ $code }}
    </p>
    <p>
        Let op! Deze code is 30 minuten geldig.
    </p>

    <p>
        Hartelijke groet,
    </p>
</body>
</html>

But in the mail the code stays like this: {{ $code }}

This is my mailable class:

<?php

namespace AppMail;

use IlluminateBusQueueable;
use IlluminateContractsQueueShouldQueue;
use IlluminateMailMailable;
use IlluminateMailMailablesContent;
use IlluminateMailMailablesEnvelope;
use IlluminateQueueSerializesModels;
use AppModelsUser;

class PasswordResetNew extends Mailable
{
    use Queueable, SerializesModels;

    private User $user;
    /**
     * Create a new message instance.
     */
    public function __construct(User $user)
    {
        $this->user = $user;
    }

    /**
     * Get the message content definition.
     */
    public function content(): Content
    {
        return new Content(
            view: 'emails.passwordReset',
            with: [
                'code' => $this->user->USER_WACHTWOORD_RESETCODE,

            ],
        );
    }

    /**
     * Get the attachments for the message.
     *
     * @return array<int, IlluminateMailMailablesAttachment>
     */
    public function attachments(): array
    {
        return [];
    }
}

And i have already debugged and the value is not empty before in the constructor and content functions.

And this mail gets called like this:
Mail::to($user->USER_EMAIL)
->send(new PasswordResetNew($user));

Thanks

How to fix “Class not found” error in Laravel 10 when running artisan command?

I’m working on a Laravel 10 project and ran into a Class not found error when executing an artisan command.

Goal: I want to create a custom artisan command that fetches data from the database.

Problem: When I run

php artisan fetch:data

I get the following error:

Target class [AppConsoleCommandsFetchData] does not exist.

What I’ve tried

  • Checked that my class FetchData.php exists under app/Console/Commands/.

  • Verified that the namespace is correct (namespace AppConsoleCommands;).

  • Registered the command inside app/Console/Kernel.php under $commands.

  • Ran composer dump-autoload.

Expected result

The artisan command should run successfully and fetch the data.

Actual result

I keep getting the Class not found error.

Error message:

In Container.php line 895:
Target class [AppConsoleCommandsFetchData] does not exist.

What could be the reason for this error and how can I fix it?

Make array of Variables with osclass custom category values

How can i make an array of veriables generated using the values passed through a while loop

I am using osclass for a uni project and i find no way whatsoever to make a list os usable variables from the custom catagory fields i added.

I have made Identifiers for the custom catagories also ( SLUGs )
and have tried many different approaches to grab and echo the custom catagory values elsewhere on the page

I cannot isolate the custom catagory values by any means.

Below is the code used to display the custom catagory values on my osclass page

<?php if( osc_count_item_meta() >= 1 ) { ?> 
   
          <?php while ( osc_has_item_meta() ) { ?>
          
                    <?php if(osc_item_meta_value()!='') { ?> 
                   
                   
                    // I WOULD LIKE TO MAKE MAKE AN ARRAY OF VERIABLES SO I CAN USE THE CUSTOM CATAGORY DATA 
                    // TRIED SO FAR if(osc_item_meta_name()!='') {  $caughtcountry = osc_item_meta_value('country'); } 
                    // BUT THIS APPROACH DOES NOT WORK 

                    <?php } ?>
            
          <?php } ?>
          
          
      
    <?php } ?>`
    

I have tried using the identifiers that i added to the catagory in Admin panel

I have also tried using the Current PHP but cannot grab the values of specific custom catagories

Below is an example of one of my attempts to grab a custom catagory value but it only shows the 1st value within the values instead of cataching the ‘age’ value using the ‘age’ identifier i used.

 <?php if( osc_count_item_meta() >0 ) {  // The If osc_count_item_meta() >=1 
      if(osc_item_meta_value('age')!='') {  $caughtage = osc_item_meta_value('age'); }  else { $caughtage=''; }
                
    }   else { $caughtage=''; }
     ?>

Also tried the following

<?php if( osc_count_item_meta() >0 ) { 

      if(osc_item_meta_name('age')!='') {  $caughtage = osc_item_meta_value('age'); }  else { $caughtage=''; }
                
    }   else { $caughtage=''; }
     ?>

Have also tried common sense but that doesnt work either

<?php if( osc_item_age()!='' ) { $Age = osc_item_age(); } else {$Age='';} ?>

I am completely stumped.

The code below loops through the custom catagories but isolating them into variables im struggling with, yet i imagine it would be as easy as an array loop

<?php if( osc_count_item_meta() >= 1 ) { ?> 

<div id="custom_fields">
<div class="meta_list">

    <?php while ( osc_has_item_meta() ) { ?>
        <?php if(osc_item_meta_value()!='') { ?> 
            <div class="meta">
                <strong><?php echo osc_item_meta_name(); ?>:</strong> 
                <span><?php echo osc_item_meta_value(); ?></span>
            </div>

        <?php } ?>
    <?php } ?>
<?php } ?>
    
  
<?php } ?>

Any help would be greatly appreciated.

Laravel testing database table is being accessed by other users

I’m currently building a multi-tenant application using stancl/tenancy (every tenant uses their own database) in my Laravel application.

Whenever I’m writing tests, tests fail a lot due to the error

IlluminateDatabaseQueryException: SQLSTATE[55006]: Object in use: 7 FEHLER:  auf Datenbank »tenant_019949ce« wird von anderen Benutzern zugegriffen
DETAIL:  1 andere Sitzung verwendet die Datenbank. (Connection: tenant_host_connection, SQL: DROP DATABASE "tenant_019949ce")

which means the table is used by another user. Tables are created when a tenant is created and should be deleted if a tenant gets deleted but it always fails in tearDown method.

My tests extend TenancyTestCase class:

use IlluminateFoundationTestingTestCase as BaseTestCase;

class TenancyTestCase extends BaseTestCase {

    use RefreshDatabase;

    private Tenant $tenant;

    protected function setUp(): void {
        parent::setUp();

        Config::set('tenancy.seeder_parameters.--class', TestDatabaseSeeder::class);

        $this->setupDefaultTenant();
        $this->forceRootUrl();

        $this->withoutVite();
    }

    private function setupDefaultTenant(): void {

        $this->tenant = Tenant::factory()->create();
        $this->tenant->domains()->save(Domain::factory([
            'domain' => 'tenant',
        ])->make());

        tenancy()->initialize($this->tenant);
    }

    private function forceRootUrl(): void {
        $parsed = parse_url(config('app.url'));
        $host = $parsed['host'] ?? 'localhost.test';
        $port = isset($parsed['port']) ? ':' . $parsed['port'] : '';

        URL::forceRootUrl('https://tenant.' . $host . $port);
    }

    public function tearDown(): void {
        tenancy()->end();
        $this->tenant->delete();

        parent::tearDown();
    }
}

I couldn’t figure out why yet, any ideas on how to fix this?

My goal is to create a single database for each test and delete them if test is completed.

Thank you.

Laravel form submission not saving to database and file uploads not working

I am working on a scholarship management system using Laravel 12, Laravel Breeze, Blade, Tailwind, and MySQL. I created a multi-step applicant form with text fields and file uploads (passport photo, Form 137, certificates, etc.).

When I submit the form, the page reloads but the data is not being saved to the database, and the uploaded files are not stored in the storage/app/public folder.

I expected the form data to be inserted into the database and the uploaded files to be saved in storage, then accessible from the admin dashboard.

I already:

Used enctype=”multipart/form-data” in my form.

Added protected $fillable in my model.

Ran migrations for the fields.

Tried using php artisan storage:link to link storage.

But the problem is still the same: no data is saved, and files don’t upload.

<?php

namespace AppHttpControllers;

use IlluminateHttpRequest;
use AppModelsApplicationForm;
use IlluminateSupportFacadesAuth;
use IlluminateSupportFacadesStorage;

class ApplicationFormController extends Controller
{
    /**
     * Show the application form for applicants.
     */
    public function create($program)
    {
        // Validate program
        if (!in_array($program, ['DOST', 'CHED'])) {
            abort(404); // If invalid program, show 404
        }

        // Pass the program to your Blade view
        return view('applicant.application-form', compact('program'));
    }

    /**
     * Store a newly created application form in storage.
     */
    public function store(Request $request)
    {
        $validated = $request->validate([
            // Basic info
            'last_name' => 'required|string|max:255',
            'first_name' => 'required|string|max:255',
            'middle_name' => 'nullable|string|max:255',
            'academic_year' => 'nullable|string|max:255',
            'school_term' => 'nullable|string|max:255',
            'application_no' => 'nullable|string|max:255',
            'program' => 'required|string|in:DOST,CHED',

            // Contact / personal details
            'birthdate' => 'nullable|date',
            'gender' => 'nullable|string|max:20',
            'civil_status' => 'nullable|string|max:50',
            'address' => 'nullable|string|max:500',
            'email' => 'nullable|email|max:255',
            'phone' => 'nullable|string|max:50',

            // Academic background
            'bs_field' => 'nullable|string|max:255',
            'bs_university' => 'nullable|string|max:255',
            'bs_scholarship_type' => 'nullable|string|max:255',
            'bs_scholarship_others' => 'nullable|string|max:255',
            'bs_remarks' => 'nullable|string|max:500',

            // Graduate intent
            'grad_field' => 'nullable|string|max:255',
            'grad_university' => 'nullable|string|max:255',
            'grad_plan' => 'nullable|string|max:255',

            // Employment
            'employer_name' => 'nullable|string|max:255',
            'employer_address' => 'nullable|string|max:500',
            'position' => 'nullable|string|max:255',
            'employment_status' => 'nullable|string|max:255',

            // Research & plans
            'research_title' => 'nullable|string|max:500',
            'career_plan' => 'nullable|string|max:500',

            // File uploads
            'passport_picture' => 'nullable|file|mimes:jpg,jpeg,png,pdf|max:4096',
            'form137' => 'nullable|file|mimes:pdf|max:4096',
            'cert_employment' => 'nullable|file|mimes:pdf|max:4096',
            'cert_purpose' => 'nullable|file|mimes:pdf|max:4096',

            'birth_certificate_pdf' => 'nullable|file|mimes:pdf|max:4096',
            'transcript_of_record_pdf' => 'nullable|file|mimes:pdf|max:4096',
            'endorsement_1_pdf' => 'nullable|file|mimes:pdf|max:4096',
            'endorsement_2_pdf' => 'nullable|file|mimes:pdf|max:4096',
            'recommendation_head_agency_pdf' => 'nullable|file|mimes:pdf|max:4096',
            'form_2a_pdf' => 'nullable|file|mimes:pdf|max:4096',
            'form_2b_pdf' => 'nullable|file|mimes:pdf|max:4096',
            'form_a_research_plans_pdf' => 'nullable|file|mimes:pdf|max:4096',
            'form_b_career_plans_pdf' => 'nullable|file|mimes:pdf|max:4096',
            'form_c_health_status_pdf' => 'nullable|file|mimes:pdf|max:4096',
            'nbi_clearance_pdf' => 'nullable|file|mimes:pdf|max:4096',
            'letter_of_admission_pdf' => 'nullable|file|mimes:pdf|max:4096',
            'approved_program_of_study_pdf' => 'nullable|file|mimes:pdf|max:4096',
            'lateral_certification_pdf' => 'nullable|file|mimes:pdf|max:4096',

            // Declaration
            'terms_and_conditions_agreed' => 'nullable|boolean',
            'applicant_signature' => 'nullable|string|max:255',
            'declaration_date' => 'nullable|date',
        ]);

        $application = new ApplicationForm();
        $application->user_id = Auth::id();
        $application->program = $request->program;
        $application->status = 'pending';
        $application->submitted_at = now();

        // Fill non-file fields
        $application->fill(collect($validated)->except([
            'passport_picture',
            'form137',
            'cert_employment',
            'cert_purpose',
            'birth_certificate_pdf',
            'transcript_of_record_pdf',
            'endorsement_1_pdf',
            'endorsement_2_pdf',
            'recommendation_head_agency_pdf',
            'form_2a_pdf',
            'form_2b_pdf',
            'form_a_research_plans_pdf',
            'form_b_career_plans_pdf',
            'form_c_health_status_pdf',
            'nbi_clearance_pdf',
            'letter_of_admission_pdf',
            'approved_program_of_study_pdf',
            'lateral_certification_pdf',
        ])->toArray());

        // File uploads
        $fileFields = [
            'passport_picture',
            'form137',
            'cert_employment',
            'cert_purpose',
            'birth_certificate_pdf',
            'transcript_of_record_pdf',
            'endorsement_1_pdf',
            'endorsement_2_pdf',
            'recommendation_head_agency_pdf',
            'form_2a_pdf',
            'form_2b_pdf',
            'form_a_research_plans_pdf',
            'form_b_career_plans_pdf',
            'form_c_health_status_pdf',
            'nbi_clearance_pdf',
            'letter_of_admission_pdf',
            'approved_program_of_study_pdf',
            'lateral_certification_pdf',
        ];

        foreach ($fileFields as $field) {
            if ($request->hasFile($field)) {
                $path = $request->file($field)->store("uploads/application_forms", "public");
                $application->$field = $path;
            }
        }

        $application->save();

        return redirect()->route('dashboard')
            ->with('success', 'Application form submitted successfully.');
    }

    /**
     * Update an existing application form.
     */
    public function update(Request $request, $id)
    {
        $application = ApplicationForm::findOrFail($id);

        // Ensure only the owner can update
        if ($application->user_id !== Auth::id()) {
            abort(403, 'Unauthorized action.');
        }

        $validated = $request->validate([
            'program' => 'required|string|max:255',
            'school' => 'required|string|max:255',
            'year_level' => 'required|string|max:50',
            'reason' => 'nullable|string|max:1000',
            // file fields
            'passport_picture' => 'nullable|image|mimes:jpg,jpeg,png|max:2048',
            'form137' => 'nullable|mimes:pdf,jpg,jpeg,png|max:4096',
            'cert_employment' => 'nullable|mimes:pdf,jpg,jpeg,png|max:4096',
            'cert_purpose' => 'nullable|mimes:pdf,jpg,jpeg,png|max:4096',
        ]);

        // Update normal fields
        $application->program = $validated['program'];
        $application->school = $validated['school'];
        $application->year_level = $validated['year_level'];
        $application->reason = $validated['reason'] ?? $application->reason;

        // Handle file uploads (optional replacement)
        if ($request->hasFile('passport_picture')) {
            $application->passport_picture = $request->file('passport_picture')->store('uploads/passport', 'public');
        }

        if ($request->hasFile('form137')) {
            $application->form137 = $request->file('form137')->store('uploads/form137', 'public');
        }

        if ($request->hasFile('cert_employment')) {
            $application->cert_employment = $request->file('cert_employment')->store('uploads/employment', 'public');
        }

        if ($request->hasFile('cert_purpose')) {
            $application->cert_purpose = $request->file('cert_purpose')->store('uploads/purpose', 'public');
        }

        // Keep status "pending" after edit
        $application->status = 'pending';
        $application->save();

        return redirect()->route('applicant.myApplication')
            ->with('success', 'Your application has been updated and set to Pending.');
    }

    /**
     * Show all applications submitted by the logged-in user.
     */
    public function viewMyApplication()
    {
        $applications = auth()->user()->applicationForms()->latest()->get();
        return view('applicant.my-application', compact('applications'));
    }

    public function edit($id)
    {
        $application = ApplicationForm::findOrFail($id);

        if ($application->user_id !== Auth::id()) {
            abort(403, 'Unauthorized action.');
        }

        return view('applicant.application-edit', compact('application'));
    }
}

HTTP request encoding

Let’s say we have an HTML form for sending data to the php/webserver server

<!DOCTYPE html>
<html>
<head>
  <title>Form</title>
</head>
<body>
  <form action="https://website.com/form.php" method="POST" accept-charset="utf-8">
    <label for="name">Name:</label>
    <input type="text" id="name" name="name"><br><br>

    <label for="email">Email:</label>
    <input type="email" id="email" name="email"><br><br>

    <input type="submit" value="Send">
  </form>
</body>
</html>

When a user sends a request to a server, how does the server know in what encoding the client sent the data? I analyzed the request headers and realized that despite using accept-charset="utf-8", the charset attribute was not added to the Content-Type header.

In general, I am interested in the following questions:

  1. How does the server know the encoding of the data sent?
  2. Is there a default encoding for HTTP request data?
  3. Can a charset be specified in the Content-Type header of an HTTP request? If so, how do I add charset?

this question in my the wocoomerce city is not listed any way and method [closed]

but my project in wordptress all ready my site cleared this question in my project is does not city listed state and country listed but does not city listed any method and technology please give me my answer.

5 year experience but this does not show in city list create surely output please surely my question follow this question any way the follow wocommerce use in my site but city list is does not provided please guides my site all over full try fronted and backend step by step follow.

Laravel works locally but fails in Docker container – “Class not found” error [closed]

Environment

  • Laravel 12+
  • Docker container (latest image)
  • PHP 8.2

The Problem

I have a Laravel application that works perfectly on my local development environment, but when I run the exact same code in a Docker container, I get this error:

Class “AppModelsvehicleStatus” not found

Notice how it’s looking for vehicleStatus (lowercase v) instead of VehicleStatus (uppercase V). The class definitely exists at app/Models/VehicleStatus.php with the correct namespace.

What’s weird

✅ Works fine locally
❌ Fails in Docker container

Same codebase, same image build. The model file exists and has correct namespace: namespace AppModels;

Other models work fine, just this one specific model

Code structure

app/Models/Vehicle.php

public function availabilityRecords(): HasMany
{
    return $this->hasMany(VehicleStatus::class);
}

app/Models/VehicleStatus.php

namespace AppModels;

class VehicleStatus extends Model
{
    // ... model code
}

Vehicle.php

protected $fillable = [
    'registration_number',
    'brand',
    'model',
    'year',
    'vehicle_release_date',
    'mileage',
    'number_of_seats',
    'fuel_type',
    'status',
    'rental_price_per_day',
    'gearbox_type',
    'air_conditioning',
    'vehicle_type',
    'is_sub_rental',
    'partner_id',
    'rental_price_per_day_from_partner',
];

protected $casts = [
    'status' => VehicleStatuses::class,
    'is_sub_rental' => 'boolean',
    'air_conditioning' => 'boolean',
    'rental_price_per_day' => 'decimal:2',
    'rental_price_per_day_from_partner' => 'decimal:2',
    'vehicle_release_date' => 'date:Y-m-d',
    'year' => 'integer',
    'mileage' => 'integer',
    'number_of_seats' => 'integer',
];

// Relationships
public function bookings(): IlluminateDatabaseEloquentRelationsHasMany
{
    return $this->hasMany(Booking::class);
}

public function partner(): IlluminateDatabaseEloquentRelationsBelongsTo
{
    return $this->belongsTo(Partner::class);
}

public function insurances(): IlluminateDatabaseEloquentRelationsHasOne
{
    return $this->hasOne(Insurance::class);
}

public function otherMaintenances(): IlluminateDatabaseEloquentRelationsHasMany
{
    return $this->hasMany(OtherMaintenance::class);
}

public function technicalInspection(): IlluminateDatabaseEloquentRelationsHasOne
{
    return $this->hasOne(TechnicalInspection::class);
}

public function oilChanges(): IlluminateDatabaseEloquentRelationsHasMany
{
    return $this->hasMany(OilChange::class);
}

public function vehicleTaxes(): IlluminateDatabaseEloquentRelationsHasMany
{
    return $this->hasMany(VehicleTax::class);
}

// Fixed relationship - explicitly specify the model class
public function availabilityRecords(): IlluminateDatabaseEloquentRelationsHasMany
{
    return $this->hasMany(VehicleStatus::class, 'vehicle_id');
}

VehicleStatus.php

protected $fillable = [
    'vehicle_id',
    'booking_id',
    'start_date_timestamp',
    'end_date_timestamp',
    'status',
];

protected $casts = [
    'status' => VehicleStatuses::class,
    'start_date_timestamp' => 'datetime:Y-m-d H:i',
    'end_date_timestamp' => 'datetime:Y-m-d H:i',
];

// Relationships
public function vehicle() : BelongsTo
{
    return $this->belongsTo(Vehicle::class);
}

public function booking() : BelongsTo
{
    return $this->belongsTo(Booking::class);
}

What I’ve tried

  • composer dump-autoload
  • php artisan cache:clear
  • php artisan config:clear
  • Restarting container
  • Rebuilding image from scratch
  • Verified file exists and has correct case

The Mystery

Why would Laravel’s autoloader work locally but not in Docker? Has anyone experienced this case-sensitivity issue specifically with Docker containers?

Looking for insights on what could cause this Docker-specific autoloading problem!

404 Not Found nginx/1.28.0

I have built this in PHP and uploaded it to GitLab. Through the pipeline, it connected to Azure and got hosted on Linux server. However, on the website, I am getting:

404 Not Found
nginx/1.28.0

I have checked all file types, and everything is correct. I also reloaded Nginx, but I am still getting the issue. Please help me solve it.

My file structure is:

generateShortlist/
lib/

Note: In the lib folder, I ran the following commands:

Invoke-WebRequest -Uri “http://www.fpdf.org/en/download/fpdf253.zip” -OutFile “fpdf.zip”

Expand-Archive -Path “fpdf.zip” -DestinationPath “lib”

Move-Item “lib/fpdf/fpdf.php” “lib/fpdf.php” (optional)

The main file is: generateShortlist.php

I want to solve the Nginx error and make my code work properly, with everything functioning correctly—like sending emails and moving data to different database tables.

Hi I want to add option product prices into the main product price which is shown above the 2 option product prices in the image [closed]

enter image description here

I want to add the option product prices into to the main product price shown above the 2 options , when quantities of either of one increase will reflect or add in the main product price shown above.
I am attaching another images for reference.

Option prices added in the main product price when quantities increase of the option product either of any real time

Force minimum TLS version for stream connections

I’m looking to force a minimum version of TLS 1.2 for my client connection. I can do something like this:

$client = stream_socket_client('tlsv1.2://www.example.com:443');

This wrapper forces a TLS 1.2 connection. But doesn’t allow for upgrades to 1.3 when the server is capable, and doesn’t connect at all if the server only offers 1.3. There don’t seem to be any options for stream_context_create() to affect the TLS version, and I don’t want to use the curl extension. Is there any possibility to do this?

I have a project I wrote in PHP. It has a connection to MySQL via MySQLi though. How can I get this open source on GitHub without leaking information? [duplicate]

I just learned PHP and only did it, because I wanted to connect it to a database, and I knew it was possible.

Long story short, project’s called Polko and is kind of a courselearning (learning via courses like w3schools) platform.

Now, because someone else is supplying something for me, I need to get this to GitHub. It would just also be nice to have this in a repository or something that I can also just access from all my devices.

But.. There is a config.php file that basically contains confidential information for connecting to the database, and I don’t want that information on GitHub, so basically everyone can get the info, and change everything in the database.

I am aware that you can make repositories private, but I’d like another solution.

I asked AI, but it didn’t fully understand the situation, and provided me with random answers about something called Laravel, which I don’t know about.