# Installation Faq's

### Remove Public From URL <a href="#remove-public-from-url" id="remove-public-from-url"></a>

**To remove the public from the URL create a .htaccess file in the root folder and write following code.**

```
<IfModule mod_rewrite.c>
	RewriteEngine On 
	RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
```

**To remove the public from URL and Force HTTPS redirection create a .htaccess file in the root folder and write the following code.**

```
<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteCond %{HTTPS} !=on
	RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] 
	RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
```

For more detail read article : <https://stackoverflow.com/questions/23837933/how-can-i-remove-public-index-php-in-the-url-generated-laravel>

**NOTE:** Remove Public not work for Localhost and sub folders.

Its work with any domain and subdomain only.

#### Remove Public From URL for LightSpeed Server <a href="#remove-public-from-url-1" id="remove-public-from-url-1"></a>

**To remove the public from the URL in LightSpeed Server -> create a .htaccess file in the root folder and write following code.**

```
RewriteEngine On 
RewriteRule ^(.*)$ public/$1 [L]
```

**To remove the public from URL and Force HTTPS redirection in LightSpeed Server -> create a .htaccess file in the root folder and write the following code.**

```
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] 
RewriteRule ^(.*)$ public/$1 [L]
```

### Hide or Denied Access .env <a href="#denied-env-1" id="denied-env-1"></a>

To Hide or Denied Access .env and create .htaccess file in the root folder and write the following code.

```
# Disable Directory listing
Options -Indexes
# block files which needs to be hidden, specify .example extension of the file
</FilesMatch "^\.env">
    Order allow,deny
    Deny from all
</FilesMatch>
```

### Debug Mode? <a href="#debug-mode" id="debug-mode"></a>

Debug mode will help you to track the error on your website. It is not all preferred to turn the debug mode on live site for a very long time.

How to turn to debug mode on

* Login to your FTP account.
* Login to your FTP account.

**Change**

```
APPi_DEBUG=false
```

**To**

```
APP_DEBUG=true
```

Save and upload the file.

```
false means debug mode is OFF
true means debug mode is ON
```

### 419 Error <a href="#id-419-error" id="id-419-error"></a>

A 419 error in Laravel can occur when a user's session has expired and sessions not save. Laravel uses the 419 status code to indicate that the user's session has expired and sessions not save.

To fix this error, you can try the following:

Its not script issue.

1. Follow mentioned PHP INI settings.
2. Increase the session lifetime: You can increase the session lifetime in your config/session.php file to prevent the session from expiring too quickly.
3. Check for session data integrity: Ensure that the session data is not lost or corrupted by checking that the session data is still present in the storage.
4. Check for Authentication : Ensure that the user is authenticated before allowing access to protected routes or resources.

Make sure PHP version 8.2 and use all following PHP settings. It shows due to the session not save in hosting.

<figure><img src="https://mediacitydocs.gitbook.io/~gitbook/image?url=https%3A%2F%2F2663140616-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfdnmCtivPgIGEf1E3BVl%252Fuploads%252F858IjstDIoN1CPyAwgGU%252Fimage.png%3Falt%3Dmedia%26token%3Dfe72489d-21c0-4ca6-9526-8cf568351b75&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=d0627b58&#x26;sv=1" alt=""><figcaption></figcaption></figure>

<figure><img src="https://851821020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXkfxdGRqNrOvTfSSLq2F%2Fuploads%2FWLlCA09J8sdu437Sfyx4%2Fimage.png?alt=media&#x26;token=e1c9946a-aef2-4a36-855e-e75c76945a19" alt=""><figcaption></figcaption></figure>

**If still you are experiencing an 419 error, you should contact your hosting provider or web administrator to troubleshoot the problem and find a solution. They will be able to examine the server logs to determine the cause of the error and take appropriate action. its not script related issue.**

### No Application Encryption key has been specified <a href="#no-application-encryption-key-has-been-specified" id="no-application-encryption-key-has-been-specified"></a>

To solve this issue you will have to check **APP\_KEY** which is located within your **. env** (environment) **file.** don't change or remove it. also check .env file not missing.

<figure><img src="https://mediacitydocs.gitbook.io/~gitbook/image?url=https%3A%2F%2F2663140616-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfdnmCtivPgIGEf1E3BVl%252Fuploads%252F26hqRKxxGtWD4nSOuVRr%252Fimage.png%3Falt%3Dmedia%26token%3Dafe15f39-1a04-4e58-93d7-35f7e5daaf2f&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=44e0601c&#x26;sv=1" alt=""><figcaption></figcaption></figure>

### .env missing <a href="#env-missing" id="env-missing"></a>

Most of times .env file not missing its just hide , so please make sure its not hide.

**cPanel show files Quick Steps:**

1. Log into cPanel & click “File Manager” under the files panel.
2. Click “settings” in the top right of the file manager.
3. Choose the Document Root (usually you can leave this as the default)
4. Check the box titled “Show Hidden Files (dotfiles) & click Save.

<figure><img src="https://mediacitydocs.gitbook.io/~gitbook/image?url=https%3A%2F%2F2663140616-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfdnmCtivPgIGEf1E3BVl%252Fuploads%252FR579jkvbpPJUylj62VvF%252Fimage.png%3Falt%3Dmedia%26token%3Dda62c3a1-b429-46e7-8087-2c959758720a&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=ebfaa84a&#x26;sv=1" alt=""><figcaption></figcaption></figure>

### Internal server error & 500 Server error <a href="#internal-server-error" id="internal-server-error"></a>

An internal server error is a general term used to describe a problem that occurs when a server is unable to process a request from a client. This can happen for a variety of reasons, such as a problem with the server's or hardware, a misconfigured server, or an issue with the client's request.

When an internal server error occurs, the server will typically return a message indicating that there was an error and that the request could not be fulfilled. This message is often accompanied by an error code, such as "500 Internal Server Error."

**Some Solution :**

* Please check the .htaccess file configuration.
* Check PHP version 8.2
* Check port 80
* Check all files extracted properly specially vendor folder.
* Check folder permissions as mentioned:&#x20;

<https://mediacitydocs.gitbook.io/quizly/installation/server-requirement>

* Exceeding server resources
* Corrupted server files

**If still you are experiencing an internal server error, you should contact your hosting provider or web administrator to troubleshoot the problem and find a solution. They will be able to examine the server logs to determine the cause of the error and take appropriate action. its not script related issue.**

Internal Server Error

<figure><img src="https://mediacitydocs.gitbook.io/~gitbook/image?url=https%3A%2F%2F2663140616-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfdnmCtivPgIGEf1E3BVl%252Fuploads%252Fc5BRs2Hn9xczSteMMOIV%252Fimage.png%3Falt%3Dmedia%26token%3D298a1181-e6fb-4d06-b18c-db6d8fe127f1&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=f7ba4bd8&#x26;sv=1" alt=""><figcaption><p>Internal Server Error</p></figcaption></figure>

<figure><img src="https://mediacitydocs.gitbook.io/~gitbook/image?url=https%3A%2F%2F2663140616-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfdnmCtivPgIGEf1E3BVl%252Fuploads%252FrvOfpzhPAdAz5fWceqAo%252Fimage.png%3Falt%3Dmedia%26token%3D2de450db-3a7a-4385-91ee-f54573e2a332&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=b8def351&#x26;sv=1" alt=""><figcaption><p>500server related error</p></figcaption></figure>

### MYSQL or Database not creating table <a href="#mysql-or-database-not-creating-table" id="mysql-or-database-not-creating-table"></a>

Please check database privilege. it must be ALL PRIVILEGES. if you don't know how to give it please contact to hosting provider.

<figure><img src="https://mediacitydocs.gitbook.io/~gitbook/image?url=https%3A%2F%2F2663140616-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfdnmCtivPgIGEf1E3BVl%252Fuploads%252Fld7UzkxNewG7BZ7aXuBX%252Fimage.png%3Falt%3Dmedia%26token%3D7df39454-6755-455b-b3f0-b2597f21fab9&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=ca7b67e7&#x26;sv=1" alt=""><figcaption></figcaption></figure>

### Class 'ZipArchive' not found <a href="#ziparchive-not-found" id="ziparchive-not-found"></a>

You are getting this error because you don't enable a zip archive extension on your server. enable zip archive extension and issue will resolved. if you don't know how to enable it please contact to hosting provider. its not script related error.

<figure><img src="https://mediacitydocs.gitbook.io/~gitbook/image?url=https%3A%2F%2F2663140616-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfdnmCtivPgIGEf1E3BVl%252Fuploads%252Fx8brkRshJsVIvCYzY7pq%252Fimage.png%3Falt%3Dmedia%26token%3Df474de19-4572-46dc-b849-7003ef034ac1&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=5b83931b&#x26;sv=1" alt=""><figcaption></figcaption></figure>

<figure><img src="https://mediacitydocs.gitbook.io/~gitbook/image?url=https%3A%2F%2F2663140616-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfdnmCtivPgIGEf1E3BVl%252Fuploads%252Fpt1xEwrfVQyegzLzNU94%252Fimage.png%3Falt%3Dmedia%26token%3Dc0105836-c9f1-4860-b054-4795c6478fb3&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=e97e18d2&#x26;sv=1" alt=""><figcaption><p>cPanel Setting for enable zip archive extension</p></figcaption></figure>

### curl\_init error <a href="#curl_init-error" id="curl_init-error"></a>

You are getting this error because you don't enable a curl extension on your server. enable curl e extension and issue will resolved. if you don't know how to enable it please contact to hosting provider. its not script related error.

<figure><img src="https://mediacitydocs.gitbook.io/~gitbook/image?url=https%3A%2F%2F2663140616-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfdnmCtivPgIGEf1E3BVl%252Fuploads%252FjYRmCIZVwqb0Fzk08skS%252Fimage.png%3Falt%3Dmedia%26token%3D3d7510fc-cadf-4c8b-96de-63e541b86f6f&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=83a7f34d&#x26;sv=1" alt=""><figcaption></figcaption></figure>

**To Enable cURL Using EasyApache on WHM:**

1. Log in to WHM as the 'root' user.
2. Either search for "EasyApache" or go to Software > EasyApache
3. Scroll down and select a build option (Previously Saved Config)
4. Click Start "Start customizing based on profile"
5. Select the version of Apache and click "Next Step".
6. Select the version of PHP and click "Next Step"
7. Chose additional options within the "Short Options List"
8. Click Exhaustive Options List.
9. Find and select the option for cURL.
10. Click curl, and then click Save and build.

### 404 error <a href="#id-404-error" id="id-404-error"></a>

A 404 error is an HTTP status code that indicates that a requested web page or resource cannot be found on a server. 404 means file not fount, its not script issue.

**This can happen for a number of reasons, including:**

* Check port 80
* Check all files extracted properly.
* Check folder permissions as mentioned :&#x20;
* Incorrect URL
* The server is down

**If still you are experiencing an 404, you should contact your hosting provider or web administrator to troubleshoot the problem and find a solution. They will be able to examine the server logs to determine the cause of the error and take appropriate action. its not script related issue.**

<figure><img src="https://mediacitydocs.gitbook.io/~gitbook/image?url=https%3A%2F%2F2663140616-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfdnmCtivPgIGEf1E3BVl%252Fuploads%252Fs4PzTsTNPWhNN71FqM6X%252Fimage.png%3Falt%3Dmedia%26token%3D619b5bff-750e-4306-81a3-8bfc0039f854&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=df92c952&#x26;sv=1" alt=""><figcaption></figcaption></figure>

### **403 error** <a href="#id-403-error" id="id-403-error"></a>

A 403 error is an HTTP status code that indicates that the client (i.e. the user's browser) is not authorized to access the requested resource. This error message is often displayed when a user attempts to access a website or webpage that they do not have permission to view. Your user who did not get permissio&#x6E;**.** So you edit the user role and then update

Certain users to access certain pages or sections. In this case, a 403 error message may be displayed if the user is not authorized to view the requested resource.

<figure><img src="https://mediacitydocs.gitbook.io/~gitbook/image?url=https%3A%2F%2F2663140616-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfdnmCtivPgIGEf1E3BVl%252Fuploads%252F09cDbnzbSxRtcDYNe549%252Fimage.png%3Falt%3Dmedia%26token%3D2d638550-e5b0-4c86-9593-7d04c8ed7859&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=4dcab619&#x26;sv=1" alt=""><figcaption></figcaption></figure>

### Payload error <a href="#payload-error" id="payload-error"></a>

A payload error in Laravel is typically caused by an issue with the data being passed to the server during an API request. This can be caused by a number of factors, including missing or incorrect data, invalid data types, or incorrect formatting of the data.

<figure><img src="https://mediacitydocs.gitbook.io/~gitbook/image?url=https%3A%2F%2F2663140616-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FfdnmCtivPgIGEf1E3BVl%252Fuploads%252F1GV7JYPHrkFvLXgAJBKp%252Fimage.png%3Falt%3Dmedia%26token%3D37d17ae7-f920-45b1-96a4-53ee45075c72&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=316f2786&#x26;sv=1" alt=""><figcaption></figcaption></figure>

Please check File and folder permissions for Shared Hosting

{% hint style="warning" %}
public\_html 775 *(public\_html folder is root folder in shared hosting)*

*if using subdomain then*&#x20;

Subdomain folder 775
{% endhint %}

File and folder permissions for VPS

{% hint style="warning" %}
/bootstrap 777&#x20;

/public 777&#x20;

/storage 777&#x20;

/public/images 777&#x20;

/public/config.txt 777

&#x20;.env 777
{% endhint %}
