Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8429393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:19:28+00:00 2026-06-10T05:19:28+00:00

I cloned the Protobuf-PHP repository: https://github.com/drslump/Protobuf-PHP.git that I found at https://github.com/drslump/Protobuf-PHP , and I

  • 0

I cloned the Protobuf-PHP repository: https://github.com/drslump/Protobuf-PHP.git that I found at https://github.com/drslump/Protobuf-PHP, and I have been working on installation and configuration problems for about 12 hours trying to get protoc-gen-php to convert a proto file into a PHP class.

I am running PHP Version 5.3.2, and here’s what I’ve done:

  1. Installed PEAR v1.9.4
  2. Installed Console_CommandLine, and ran PEAR_ENV.reg to set the PEAR environment variables.
  3. I have tried every permutation I can think of to try to get this plugin to generate a PHP class file, and every attempt has failed.

I have a proto file that we’re using with a C# project in the root folder where I checked out the proto-gen-php project (see below).

    message AuditLogEntry {
        required int64 ID = 1;
        required int64 Date = 2;
        required string Message = 3;

        optional int32 User_ID = 4;
        optional string User_Username = 5;
        optional int32 ImpUser_ID = 6;
        optional string ImpUser_Username = 7;

        optional string RemoteIP = 8;
    }


    message AuditLogQuery {
        optional int64 DateRangeStart = 1;
        optional int64 DateRangeEnd = 2;
        optional string Search = 3;
        optional int32 UserID = 4;

        optional int32 Limit = 5;
        optional int32 Offset = 6;
    }

    message AuditLogResult {
        repeated AuditLogEntry LogEntries = 1;
        optional int32 TotalResults = 2;
    }

Here are just a few problems that I’m having:

  1. When I attempt to execute the most basic implementation:

    protoc-gen-php.bat AuditLog.proto
    

    I get this error:

    Could not open input file: @bin_dir@\protoc-gen-php
    The filename, directory name, or volume label syntax is incorrect.

    I cannot find any information regarding this error online. Is there a configuration problem with the installation of one of the packages that I’m using? Any ideas?

  2. Because of the error above, I changed this line in the protoc-gen-php batch file:

    "%PHPBIN%" -d display_errors=stderr -d log_errors=On -d error_log=Off "@bin_dir@\protoc-gen-php" %*
    

    to

    "%PHPBIN%" -d display_errors=stderr -d log_errors=On -d error_log=Off "protoc-gen-php.php" %*
    

Now when I run the same command given in problem 1, I get the following output:

The filename, directory name, or volume label syntax is incorrect.
Protobuf-PHP @package_version@ by Ivan -DrSlump- Montes

C:\Development\SkedFlex\php-proto-buffers\AuditLog.proto: File does not reside within any path specified using --proto_path (or -I).  You must specify a --proto_path which encompasses this file.  Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think).

ERROR: protoc exited with an error (1) when executed with:
  protoc \
    --plugin=protoc-gen-php="C:\Development\SkedFlex\php-proto-buffers\protoc-gen-php.php.bat" \
    --proto_path="C:\Development\SkedFlex\php-proto-buffers\library\DrSlump\Protobuf\Compiler\protos" \
    --php_out=":./" \
    "C:\Development\SkedFlex\php-proto-buffers\AuditLog.proto"

I tried many variations of the command using -i, -o as specified in the manual: http://drslump.github.com/Protobuf-PHP/protoc-gen-php.1.html, but cannot seem to make headway on this…

Finally I resorted to attempting to execute protoc directly:

protoc --plugin=protoc-gen-php --php_out=./build AuditLog.proto

this is the error:

--php_out: protoc-gen-php: The system cannot find the file specified.

I am at a point where I’m stuck. Is there anyone that has experience with protoc-gen-php that can help me resolve the problems that I am having?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:19:30+00:00Added an answer on June 10, 2026 at 5:19 am

    The .bat file cannot be used directly after checking it out from the repository, it is modified when creating a Pear package. Thus you should install Protobuf-PHP using Pear unless you want to modify the source code of the library somehow.

    pear channel-discover pear.pollinimini.net
    pear install drslump/Protobuf-beta
    

    If you don’t want to install from Pear you’ll have to manually modify the protoc-gen-php.bat file replacing the last line with something similar to this:

    C:\path\to\php.exe -d display_errors=stderr -d log_errors=On -d error_log=Off c:\path\to\protobuf-php\protoc-gen-php %*
    

    In order to fix the “File does not reside within any path specified…” error you must make sure that any proto file given as argument resides inside a defined include path. Google’s protoc compiler does not try to guess what the include paths are so we need to provide them manually in all cases.

    protoc-gen-php.bat -i . AuditLog.proto
    

    That should allow you to generate the PHP files for your proto messages, although the script is not as tested in Windows systems as is in Linux and OSX ones. If you find any issues you can report them directly at the project site if you wish.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have cloned a repo with 2 branches from github: git clone https://github.com/user/repo cd
I cloned this repo on my computer: https://github.com/derobins/wmd.git There are several bugs with it
Hi cloned a simple app ( https://github.com/cfx/twix ) on github that allows me to
I cloned from https://github.com/facebook/facebook-ios-sdk.git today, and noticed two spots in the code which have
I cloned a git repo that I have hosted on github to my laptop.
I have cloned a git repository on Windows and noticed that the line endings
I have cloned a remote SVN repository with git-svn. I have modified a pom.xml
I accidentally added a cloned git repository to a working copy clone of my
I have a working java client that is communicating with Google, through ProtoBuf serialized
I cloned an SVN repository down and I've been working on master - checking

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.