Make XAMPP program directory writeable?

294

Solution 1

Sounds like a permissions problem. You can set permissions for the XAMPP folder by right clicking on it and click on Get Info. From there expand Sharing and Permissions at the bottom if it already isn't. Depending on where the folder is you may need to click the lock icon at the bottom right to allow you to make changes. Then you will have access to change the permissions.

If your user account is not in there already, click the little + icon in the lower left and add your user account in. Finally, next to your account name in the Privilege column select Read and Write. You should now be able to write files into this folder, and this process is also the same for adding write permissions to files.

Solution 2

Here is alternative solution which involves making Apache to run under your UNIX user account Local XAMPP development and UNIX file permissions

Solution 3

If you use Mac OS X and XAMPP, let's assume that your folder with your site or API located in folder /Applications/XAMPP/xamppfiles/htdocs/API. Then you can grant access like this:

$ chmod 777 /Applications/XAMPP/xamppfiles/htdocs/API

And now open the page inside the folder:

http://localhost/API/index.php

Solution 4

Right click on the folder you want to write on choose Get Info and at the bottom you can change Sharing & Permissions now they must be read only and you should change them to read and write. good luck...

Share:
294

Related videos on Youtube

Lave Loos
Author by

Lave Loos

Updated on September 17, 2022

Comments

  • Lave Loos
    Lave Loos over 1 year

    I've got a external database (reading rights only) with fields containing codes representing stringdata. Unfortunatetly, the codes and explanations are not digitalized. Instead, I've got a bunch of papers stating T=Toyota, M=Mercedes, F=Ferrari, etc..

    I'm looking for a way to convert these codes into full strings and keep things maintainable.

    [Desired result]              [Current result]
     -Regnumber   -Brand          -Regnumber    -Brand
     ABC001        Toyota          ABC001        T
     FGH783        Ferrari         FGH783        F
     LKJ345        Mercedes        LKJ345M       M
    

    I considered using enums, but that seems like a lot of work declaring (500+ values) so I was thinking using resource files (XML should be easy to maintain) but I'm open for suggestions.

    My plan was to create a seperate resource file for every table containing codes:

    ./Resources/Cars/BRAND.resx
    ./Resources/House/BUILDINGTYPE.resx
    ./Resources/House/COLOR.resx
    ./Resources/Flowers/NAME.resx
    

    That way, it would be easy to locate and change the content in the future. But I would like to know what would be a good place (Model, View, other) to receive the values from the resource file?

    Furthermore, I tried to use DataAnnotations but I'm probably missing the point completely. I was under the impression that one could pass a database value to a resource file just by adding a data annotation of display type "ResourceType = foo" but then I get the following error:

    Cannot retrieve property 'Name' because localization failed. Type 'MyProject.Resources.Car.BRAND' is not public or does not contain a public static string property with the name 'registration number'

    It seems like the resource file is using the display name instead of the field value retrieved from the database (the access modifier IS set to public)


    Model

        // ...
    
        [Key]
        public int ID { get; set; }
    
        [Display(Name="registration number")]
        public string registrationNr { get; set; }
    
        [Display(Name="Brand", ResourceType = typeof(Resources.Car.BRAND))]
        public string BrandCode { get; set; }
    
        //...
    

    View

    foreach(modelItem in Model.Car)
    {
        //...
    
        @Html.DisplayNameFor(modelItem => modelItem.BrandCode)
        @Html.DisplayFor(modelItem => modelItem.BrandCode)
    
        //...
    }   
    

    However, the solution of my problem doesn't have to use resource files, as long as I can map codes to values and maintain them I'd be a happy man. Thanks in advance!

    • rabidmachine9
      rabidmachine9 over 13 years
      Can you describe the problem more clear please?
  • Simon Hughes
    Simon Hughes over 13 years
    Plus one for the bit about adding my User Account to the list.
  • Lave Loos
    Lave Loos almost 11 years
    That is a good solution, though I would have to create my own database in that case. I only have reading rights on the original (external) database. Hopefully someone can shine a light on other solutions too.