Change htdocs from XAMPP to the pendrive folder (or use XAMPP on the Pendriver)

0

I've already searched my ass, changed everything that was httpd.conf and httpd-xampp.conf, but nothing worked.

I'm trying to change the default htdocs xampp folder to a folder on my pendriver, but when the localhost requirement in the browser is returned:

  

Access Forbidden!

     

You do not have permission to access the requested directory. Can not   the index file exists, or the directory may be protected against   reading.

     

If you believe you have encountered a problem on the server, please   please contact the webmaster.

     

Error 403 localhost Apache / 2.4.29 (Win32) OpenSSL / 1.1.0g PHP / 7.2.2

Can anyone help me? (The xampp is installed on the PC's C:

Edit:

Following more or less what @AndreMesquita said and some articles google it out ... I made the following configuration in httpd.conf:

DocumentRoot "S:\Git\projeto"
<Directory "S:\Git\projeto">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    #Options Indexes FollowSymLinks Includes ExecCGI

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    #AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    #Require all granted

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

</Directory>

Still unsuccessful ...

    
asked by anonymous 14.03.2018 / 15:50

3 answers

0

I did it! I decided to follow the other option that @RafaelSouzaCalearo gave ...

If someone has the same problem as me, (tried installing xampp in several ways) these commands may be useful:

  • ERROR:
  Apache Service detected with wrong path

     MySQL Service detected with wrong path

     

Found Path: "C: \ xampp \ apache \ bin \ httpd.exe" -k runservice   Expected Path: "s: \ xampp \ apache \ bin \ httpd.exe" -k runservice

     

Found Path: C: \ xampp \ mysql \ bin \ mysqld.exe   --defaults-file = c: \ xampp \ mysql \ bin \ my.ini mysql   Expected Path: s: \ xampp \ mysql \ bin \ mysqld.exe   --defaults-file = s: \ xampp \ mysql \ bin \ my.ini mysql

Reason:

There are xampp services that have not been removed from windows after uninstalling

How to fix:

Delete these services that are preventing portable xampp from starting!

Open CMD as admin and run:

sc delete nome_do_serviço

In my case they were "Apache2.4" and "mysql", after deleting these services, restart XAMPP.

  • ERROR:
  

Problem detected!

     

Port 80 in use by "Unable to get info" with PID 7612!

     

Port 443 in use by "Unable to get info" with PID 7612!

     

Port 3306 in use by "Unable to get info!"

Reason:

The pendrive may have been removed without finalizing the modules and now the ports are being taken up by processes that windows kept.

How to fix:

Sometimes XAMPP shows the PID of the process that is occupying the port, simply finishing these processes with the CMD in administrator mode:

taskKill.exe /F /PID n_do_PID_AQUI

But sometimes it does not show the PID as it did with the error on port 3306 that I showed above, so it is necessary to search the process through the port and see what the PID is:

netstat -a -n -o | findstr :n_da_porta

The CMD will show all processes, just see the PID number (last column) and run the taskKill again and restart XAMPP.

    
15.03.2018 / 13:15
0

You need to locate and append the apache configuration file:

<Directory K:\inetput\>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all 
</Directory>

Where, K: \ inetput \ is the path of the pendrive.

Hope it helps. Anything, he says and we'll hit the right answer.

Abs

    
14.03.2018 / 17:58
0

Follow step by step

  • Open xampp
  • Config
  • Apache httpd.conf
  • Use CTRL + F
  • DocumentRoot "C: / xampp / htdocs"
  • <Directory "C:/xampp/htdocs">
  • Put the directory you want.

        
    14.03.2018 / 21:44